diff --git a/package.json b/package.json index 113d21a6a0..f33a4321bf 100644 --- a/package.json +++ b/package.json @@ -61,11 +61,12 @@ "@ethersproject/bytes": "^5.8.0", "@ethersproject/rlp": "^5.8.0", "@grpc/grpc-js": "^1.12.6", - "@hashgraph/cryptography": "1.9.0", - "@hashgraph/proto": "2.22.0", + "@hashgraph/cryptography": "file:.yalc/@hashgraph/cryptography", + "@hashgraph/proto": "file:.yalc/@hashgraph/proto", "bignumber.js": "^9.1.1", "bn.js": "^5.1.1", "crypto-js": "^4.2.0", + "import-sync": "^2.2.3", "js-base64": "^3.7.4", "long": "^5.3.1", "pino": "^9.6.0", @@ -135,5 +136,6 @@ }, "resolutions": { "bn.js": "5.2.1" - } + }, + "packageManager": "pnpm@9.15.5+sha512.845196026aab1cc3f098a0474b64dfbab2afe7a1b4e91dd86895d8e4aa32a7a6d03049e2d0ad770bbe4de023a7122fb68c1a1d6e0d033c7076085f9d5d4800d4" } diff --git a/packages/proto/Taskfile.yml b/packages/proto/Taskfile.yml index 3275b0b38b..d44f7627be 100644 --- a/packages/proto/Taskfile.yml +++ b/packages/proto/Taskfile.yml @@ -61,6 +61,7 @@ tasks: - install cmds: - task "build:standalone" + - task "build:minimal:transactions" build:standalone: cmds: @@ -73,6 +74,130 @@ tasks: - npx copyfiles -u 1 src/index.d.ts src/proto.d.ts lib/ > /dev/null # This is necessary to correctly run browser tests with an unpublished proto package - npx yalc publish > /dev/null + build:minimal:transactions: + desc: "Generate individual JS files for each transaction proto file" + cmds: + - mkdir -p src/minimal + - | + success_count=0 + fail_count=0 + + # Generate individual transaction files with specific dependencies + for proto_file in minimal_src/*_transaction.proto; do + if [ -f "$proto_file" ]; then + base_name=$(basename "$proto_file" .proto) + echo "Generating $base_name.js..." + + # Get the imports from the transaction file + imports=$(grep -h '^import' "$proto_file" | sed 's/import "\(.*\)";/minimal_src\/\1/' | tr '\n' ' ') + + # Get list of directly imported files (without minimal_src/ prefix) + direct_imports=$(grep -h '^import' "$proto_file" | sed 's/import "\(.*\)";/\1/' | tr '\n' ' ') + + # Build common deps, excluding any that are directly imported + common_deps="" + for dep in duration.proto basic_types.proto custom_fees.proto timestamp.proto google_protobuf_wrappers.proto; do + if ! echo "$direct_imports" | grep -q "$dep"; then + common_deps="$common_deps minimal_src/$dep" + fi + done + + # Generate each transaction with its own unique namespace to avoid conflicts + unique_namespace="hashgraph_${base_name}" + if npx pbjs -r "$unique_namespace" -t static-module -w es6 -p=minimal_src --dependency protobufjs/minimal --force-long --no-beautify --no-convert --no-delimited --no-verify -o "src/minimal/${base_name}.js" "$proto_file" $imports $common_deps 2>/dev/null; then + npx pbjs -r "transaction_contents" -t static-module -w es6 -p=minimal_src --dependency protobufjs/minimal --force-long --no-beautify --no-convert --no-delimited --no-verify -o "src/minimal/transaction_contents.js" transaction_contents.proto timestamp.proto google_protobuf_wrappers.proto + npx pbjs -r "transaction_response" -t static-module -w es6 -p=minimal_src --dependency protobufjs/minimal --force-long --no-beautify --no-convert --no-delimited --no-verify -o "src/minimal/transaction_response.js" transaction_response.proto timestamp.proto google_protobuf_wrappers.proto + npx pbts -n "$unique_namespace" -o src/minimal/${base_name}.d.ts src/minimal/${base_name}.js + npx pbts -n "transaction_contents" -o src/minimal/transaction_contents.d.ts src/minimal/transaction_contents.js + npx pbts -n "transaction_response" -o src/minimal/transaction_response.d.ts src/minimal/transaction_response.js + echo "✓ Successfully generated $base_name.js" + success_count=$((success_count + 1)) + fi + fi + done + + echo "" + echo "Summary: $success_count files generated successfully, $fail_count failed" + if [ $success_count -gt 0 ]; then + echo "✓ Each generated JS file contains the specific transaction and its dependencies" + fi + if [ $fail_count -gt 0 ]; then + echo "Note: Failed files likely have missing dependencies that need to be added to minimal_src/" + fi + - npx copyfiles -u 1 "src/minimal/*.d.ts" lib/ > /dev/null + - npx babel src/minimal -d lib/minimal + - task: generate:minimal:index + + generate:minimal:index: + desc: "Generate index.js file for tree-shaking support in lib/minimal" + cmds: + - | + echo "Generating lib/minimal/index.js for tree-shaking..." + + # Create the index.js content + cat > lib/minimal/index.js << 'EOF' + // Auto-generated index file for minimal transaction proto modules + // This enables tree-shaking by providing named exports for each transaction type + + EOF + + # Add named exports for each .js file + for js_file in lib/minimal/*.js; do + if [ -f "$js_file" ]; then + base_name=$(basename "$js_file" .js) + # Skip index.js to avoid circular reference + if [ "$base_name" != "index" ]; then + # Convert snake_case to PascalCase + class_name=$(echo "$base_name" | awk -F_ '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1' OFS="") + echo "export { default as $class_name } from \"./$base_name.js\";" >> lib/minimal/index.js + fi + fi + done + + echo "" >> lib/minimal/index.js + echo "// For backwards compatibility, also export all as a single object" >> lib/minimal/index.js + echo "export default {" >> lib/minimal/index.js + + # Add dynamic imports for default export + for js_file in lib/minimal/*.js; do + if [ -f "$js_file" ]; then + base_name=$(basename "$js_file" .js) + # Skip index.js to avoid circular reference + if [ "$base_name" != "index" ]; then + # Convert snake_case to PascalCase + class_name=$(echo "$base_name" | awk -F_ '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1' OFS="") + echo " $class_name: () => import(\"./$base_name.js\")," >> lib/minimal/index.js + fi + fi + done + + echo "};" >> lib/minimal/index.js + + # Count the exports + export_count=$(grep -c "export { default as" lib/minimal/index.js) + echo "✓ Generated index.js with $export_count transaction exports" + - task: generate:minimal:index:types + + generate:minimal:index:types: + desc: "Generate TypeScript definitions for lib/minimal/index.js" + cmds: + - | + # Generate index.d.ts for the minimal package + echo "// Auto-generated index types for minimal transaction proto modules" > lib/minimal/index.d.ts + echo "// This enables tree-shaking by providing named exports for each transaction type" >> lib/minimal/index.d.ts + echo "" >> lib/minimal/index.d.ts + + # Convert export statements to TypeScript + grep "^export { default as" lib/minimal/index.js | sed 's/\.js";$/";/' >> lib/minimal/index.d.ts + + # Add default export type + echo "" >> lib/minimal/index.d.ts + echo "// For backwards compatibility, also export all as a single object" >> lib/minimal/index.d.ts + echo "declare const _default: {" >> lib/minimal/index.d.ts + grep "() => import" lib/minimal/index.js | sed 's/: () => import(\"\(.*\)\.js\"),/: () => Promise;/' >> lib/minimal/index.d.ts + echo "};" >> lib/minimal/index.d.ts + echo "" >> lib/minimal/index.d.ts + echo "export default _default;" >> lib/minimal/index.d.ts clean: cmds: @@ -98,7 +223,7 @@ tasks: "lint:js": cmds: - - npx eslint --fix "src/*.js" + - npx eslint --fix "src/proto.js" "test:release": deps: diff --git a/packages/proto/minimal_src/atomic_batch_transaction.proto b/packages/proto/minimal_src/atomic_batch_transaction.proto new file mode 100644 index 0000000000..06d01ee84d --- /dev/null +++ b/packages/proto/minimal_src/atomic_batch_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Atomic Batch Transaction + * Transaction for handling a set of transactions atomically. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for atomic batch. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for handling a set of transactions atomically. + */ +message AtomicBatchTransactionBody { + /** + * A list of signed bytes that represent the batch transactions. + */ + repeated bytes transactions = 1; +} + +/** + * A transaction body for atomic batch. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * A transaction body for handling a set of transactions atomically. + */ + AtomicBatchTransactionBody atomic_batch = 74; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} diff --git a/packages/proto/minimal_src/basic_types.proto b/packages/proto/minimal_src/basic_types.proto new file mode 100644 index 0000000000..eb39e3b0d9 --- /dev/null +++ b/packages/proto/minimal_src/basic_types.proto @@ -0,0 +1,2519 @@ +/** + * # Basic Types + * Fundamental message types used across transactions and state as field types. + * + * ### Requirements for identifier values + * - Most entities in the network SHALL be identified by a multi-part + * identifier. These identifier values SHALL consist of a shard, a realm, and + * an entity identifier. + * - Shard, Realm, and Entity Number MUST all be whole numbers. + * - A Shard SHALL be globally unique. + * - A Realm MAY be reused between shards, but SHALL be unique within a shard. + * - An Entity Number MAY be reused between shards and realms, but SHALL be + * unique within each combination of shard and realm. + * - Every object (e.g. account, file, token, etc...) SHALL be scoped to exactly + * one realm and shard. Thus a File has a FileID, a numeric triplet, such as + * 0.0.2 for shard 0, realm 0, entity 2. + * - Identifier values SHOULD use an Entity Number as the third component of the + * identifier. Some, however, MAY use alternative or composite values for the + * Entity portion of the three part identifier. Any such alternative or + * composite value MUST be unique within that shard and realm combination. + * - The entity portion of the identifier, regardless of type, MUST be unique + * within that realm and shard combination and MAY be globally unique. + * - The triplet of shard.realm.entity MUST be globally unique, even across + * different identifier types. + * - Each realm SHALL maintain a single counter for entity numbers, so if there + * is an identifier with value 0.1.2, then there MUST NOT be an identifier + * with value 0.1.2 for any other object. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +import "timestamp.proto"; +import "google/protobuf/wrappers.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; + +/** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ +message ShardID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; +} + +/** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ +message RealmID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; +} + +/** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ +message TokenID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; + + /** + * A whole number token identifier. + */ + int64 tokenNum = 3; +} + +/** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ +enum BlockHashAlgorithm { + /** + * A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + SHA2_384 = 0; +} + +/** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ +message AccountID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; + + oneof account { + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + int64 accountNum = 3; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + bytes alias = 4; + } +} + +/** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ +message NftID { + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + TokenID token_ID = 1; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + int64 serial_number = 2; +} + +/** + * An identifier for a File within the network. + */ +message FileID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; + + /** + * A whole number file identifier, unique within its realm and shard. + */ + int64 fileNum = 3; +} + +/** + * An identifier for a smart contract within the network. + */ +message ContractID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; + + oneof contract { + /** + * A whole number contract identifier, unique within its realm and shard. + */ + int64 contractNum = 3; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + bytes evm_address = 4; + } +} + +/** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ +message TopicID { + /** + * A whole number shard identifier. + */ + int64 shardNum = 1; + + /** + * A whole number realm identifier. + */ + int64 realmNum = 2; + + /** + * A whole number topic identifier, unique within its realm and shard. + */ + int64 topicNum = 3; +} + +/** + * An unique identifier for a Schedule + */ +message ScheduleID { + /** + * A whole number shard + */ + int64 shardNum = 1; + + /** + * A whole number realm + */ + int64 realmNum = 2; + + /** + * A whole number schedule, unique within its realm and shard + */ + int64 scheduleNum = 3; +} + +/** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ +message TransactionID { + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + Timestamp transactionValidStart = 1; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + AccountID accountID = 2; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + bool scheduled = 3; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + int32 nonce = 4; +} + +/** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ +message AccountAmount { + /** + * An account identifier that will send or receive token(s). + */ + AccountID accountID = 1; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + sint64 amount = 2; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + bool is_approval = 3; +} + +/** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ +message TransferList { + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + repeated AccountAmount accountAmounts = 1; +} + +/** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ +message NftTransfer { + /** + * An Account identifier for the sender. + */ + AccountID senderAccountID = 1; + + /** + * An Account identifier for the receiver. + */ + AccountID receiverAccountID = 2; + + /** + * A serial number for the NFT to transfer. + */ + int64 serialNumber = 3; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + bool is_approval = 4; +} + +/** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ +message TokenTransferList { + /** + * A token identifier.
+ * This is the token to be transferred. + */ + TokenID token = 1; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + repeated AccountAmount transfers = 2; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + repeated NftTransfer nftTransfers = 3; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + google.protobuf.UInt32Value expected_decimals = 4; +} + +/** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ +message Fraction { + /** + * A fractional number's numerator. + */ + int64 numerator = 1; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + int64 denominator = 2; +} + +/** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ +enum TokenType { + /** + * A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + */ + FUNGIBLE_COMMON = 0; + + /** + * A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + NON_FUNGIBLE_UNIQUE = 1; +} + +/** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ +enum SubType { + /** + * The resource cost for the transaction type has no additional attributes + */ + DEFAULT = 0; + + /** + * The resource cost for the transaction type includes an operation on a + * fungible/common token + */ + TOKEN_FUNGIBLE_COMMON = 1; + + /** + * The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + */ + TOKEN_NON_FUNGIBLE_UNIQUE = 2; + + /** + * The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + */ + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3; + + /** + * The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + */ + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4; + + /** + * The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + */ + SCHEDULE_CREATE_CONTRACT_CALL = 5; + + /** + * The resource cost for the transaction type includes a TopicCreate + * with custom fees. + */ + TOPIC_CREATE_WITH_CUSTOM_FEES = 6; + + /** + * The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7; +} + +/** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ +enum TokenSupplyType { + /** + * An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + */ + INFINITE = 0; + + /** + * A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + FINITE = 1; +} + +/** + * Types of validation strategies for token keys. + */ +enum TokenKeyValidation { + /** + * Perform all token key validations.
+ * This is the default value and behavior. + */ + FULL_VALIDATION = 0; + + /** + * Perform no validations at all for all passed token keys. + */ + NO_VALIDATION = 1; +} + +/** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ +enum TokenFreezeStatus { + /** + * The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + */ + FreezeNotApplicable = 0; + + /** + * The token is currently frozen for the designated account. + */ + Frozen = 1; + + /** + * The token is not currently frozen for the designated account. + */ + Unfrozen = 2; +} + +/** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ +enum TokenKycStatus { + /** + * The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + */ + KycNotApplicable = 0; + + /** + * The designated account is currently granted KYC status for the + * designated token. + */ + Granted = 1; + + /** + * The designated account is not currently granted KYC status for the + * designated token. + */ + Revoked = 2; +} + +/** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ +enum TokenPauseStatus { + /** + * The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + */ + PauseNotApplicable = 0; + + /** + * The token is currently paused. + */ + Paused = 1; + + /** + * The token is not currently paused. + */ + Unpaused = 2; +} + +/** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ +message Key { + oneof key { + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + ContractID contractID = 1; + + /** + * An array of Ed25519 public key bytes. + */ + bytes ed25519 = 2; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + bytes RSA_3072 = 3 [deprecated = true]; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + bytes ECDSA_384 = 4 [deprecated = true]; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + ThresholdKey thresholdKey = 5; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + KeyList keyList = 6; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + bytes ECDSA_secp256k1 = 7; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + ContractID delegatable_contract_id = 8; + } +} + +/** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ +message ThresholdKey { + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + uint32 threshold = 1; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + */ + KeyList keys = 2; +} + +/** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ +message KeyList { + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + repeated Key keys = 1; +} + +/** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ +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 MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ +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 MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ +message SignatureList { + option deprecated = true; + + /** + * Each signature corresponds to a Key in the KeyList. + */ + repeated Signature sigs = 2; +} + +/** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ +message SignaturePair { + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + bytes pubKeyPrefix = 1; + + oneof signature { + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + bytes contract = 2; + + /** + * An Ed25519 signature. + */ + bytes ed25519 = 3; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + bytes RSA_3072 = 4 [deprecated = true]; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + bytes ECDSA_384 = 5 [deprecated = true]; + + /** + * An ECDSA(secp256k1) signature. + */ + bytes ECDSA_secp256k1 = 6; + } +} + +/** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ +message SignatureMap { + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + repeated SignaturePair sigPair = 1; +} + +/** + * The transactions and queries supported by Hedera Hashgraph. + */ +enum HederaFunctionality { + // FUTURE - Uncomment when https://github.com/hashgraph/pbj/issues/339 is fixed; + // currently the PBJ-generated unit tests fail when using reserved ordinals + // reserved 96, 97, 98, 99; + + /** + * Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + */ + NONE = 0; + + /** + * Transfer tokens among accounts. + */ + CryptoTransfer = 1; + + /** + * Update an account. + */ + CryptoUpdate = 2; + + /** + * Delete an account. + */ + CryptoDelete = 3; + + /** + * Add a livehash to an account + */ + CryptoAddLiveHash = 4 [deprecated = true]; + + /** + * Delete a livehash from an account + */ + CryptoDeleteLiveHash = 5 [deprecated = true]; + + /** + * Execute a smart contract call. + */ + ContractCall = 6; + + /** + * Create a smart contract. + */ + ContractCreate = 7; + + /** + * Update a smart contract. + */ + ContractUpdate = 8; + + /** + * Create a "file" stored in the ledger. + */ + FileCreate = 9; + + /** + * Append data to a "file" stored in the ledger. + */ + FileAppend = 10; + + /** + * Update a "file" stored in the ledger. + */ + FileUpdate = 11; + + /** + * Delete a "file" stored in the ledger. + */ + FileDelete = 12; + + /** + * Get the balance for an account. + */ + CryptoGetAccountBalance = 13; + + /** + * Get a full account record. + */ + CryptoGetAccountRecords = 14; + + /** + * Get information about a token. + */ + CryptoGetInfo = 15; + + /** + * Execute a local smart contract call.
+ * Used by contracts to call other contracts. + */ + ContractCallLocal = 16; + + /** + * Get information about a smart contract. + */ + ContractGetInfo = 17; + + /** + * Get the compiled bytecode that implements a smart contract. + */ + ContractGetBytecode = 18; + + /** + * Get a smart contract record by reference to the solidity ID. + */ + GetBySolidityID = 19; + + /** + * Get a smart contract by reference to the contract key. + */ + GetByKey = 20; + + /** + * Get the live hash for an account + */ + CryptoGetLiveHash = 21 [deprecated = true]; + + /** + * Get the accounts proxy staking to a given account. + */ + CryptoGetStakers = 22 [deprecated = true]; + + /** + * Get the contents of a "file" stored in the ledger. + */ + FileGetContents = 23; + + /** + * Get the metadata for a "file" stored in the ledger. + */ + FileGetInfo = 24; + + /** + * Get transaction record(s) for a specified transaction ID. + */ + TransactionGetRecord = 25; + + /** + * Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + */ + ContractGetRecords = 26 [deprecated = true]; + + /** + * Create a new account + */ + CryptoCreate = 27; + + /** + * Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + */ + SystemDelete = 28; + + /** + * Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + */ + SystemUndelete = 29; + + /** + * Delete a smart contract + */ + ContractDelete = 30; + + /** + * Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + */ + Freeze = 31; + + /** + * Create a Transaction Record.
+ * This appears to be purely internal and unused. + */ + CreateTransactionRecord = 32; + + /** + * Auto-renew an account.
+ * This is used for internal fee calculations. + */ + CryptoAccountAutoRenew = 33; + + /** + * Auto-renew a smart contract.
+ * This is used for internal fee calculations. + */ + ContractAutoRenew = 34; + + /** + * Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + */ + GetVersionInfo = 35; + + /** + * Get a receipt for a specified transaction ID. + */ + TransactionGetReceipt = 36; + + /** + * Create a topic for the Hedera Consensus Service (HCS). + */ + ConsensusCreateTopic = 50; + + /** + * Update an HCS topic. + */ + ConsensusUpdateTopic = 51; + + /** + * Delete an HCS topic. + */ + ConsensusDeleteTopic = 52; + + /** + * Get metadata (information) for an HCS topic. + */ + ConsensusGetTopicInfo = 53; + + /** + * Publish a message to an HCS topic. + */ + ConsensusSubmitMessage = 54; + + /** + * Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + */ + UncheckedSubmit = 55; + + /** + * Create a token for the Hedera Token Service (HTS). + */ + TokenCreate = 56; + + /** + * Get metadata (information) for an HTS token. + */ + TokenGetInfo = 58; + + /** + * Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + */ + TokenFreezeAccount = 59; + + /** + * Remove a "freeze" from an account with respect to a specific HTS token. + */ + TokenUnfreezeAccount = 60; + + /** + * Grant KYC status to an account for a specific HTS token. + */ + TokenGrantKycToAccount = 61; + + /** + * Revoke KYC status from an account for a specific HTS token. + */ + TokenRevokeKycFromAccount = 62; + + /** + * Delete a specific HTS token. + */ + TokenDelete = 63; + + /** + * Update a specific HTS token. + */ + TokenUpdate = 64; + + /** + * Mint HTS token amounts to the treasury account for that token. + */ + TokenMint = 65; + + /** + * Burn HTS token amounts from the treasury account for that token. + */ + TokenBurn = 66; + + /** + * Wipe all amounts for a specific HTS token from a specified account. + */ + TokenAccountWipe = 67; + + /** + * Associate a specific HTS token to an account. + */ + TokenAssociateToAccount = 68; + + /** + * Dissociate a specific HTS token from an account. + */ + TokenDissociateFromAccount = 69; + + /** + * Create a scheduled transaction + */ + ScheduleCreate = 70; + + /** + * Delete a scheduled transaction + */ + ScheduleDelete = 71; + + /** + * Sign a scheduled transaction + */ + ScheduleSign = 72; + + /** + * Get metadata (information) for a scheduled transaction + */ + ScheduleGetInfo = 73; + + /** + * Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + */ + TokenGetAccountNftInfos = 74 [deprecated = true]; + + /** + * Get metadata (information) for a specific NFT identified by token and + * serial number. + */ + TokenGetNftInfo = 75 [deprecated = true]; + + /** + * Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + */ + TokenGetNftInfos = 76; + + /** + * Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + */ + TokenFeeScheduleUpdate = 77; + + /** + * Get execution time(s) for one or more "recent" TransactionIDs. + */ + NetworkGetExecutionTime = 78 [deprecated = true]; + + /** + * Pause a specific HTS token + */ + TokenPause = 79; + + /** + * Unpause a paused HTS token. + */ + TokenUnpause = 80; + + /** + * Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + */ + CryptoApproveAllowance = 81; + + /** + * Delete (unapprove) an allowance previously approved + * for the owner account. + */ + CryptoDeleteAllowance = 82; + + /** + * Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + */ + GetAccountDetails = 83; + + /** + * Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + */ + EthereumTransaction = 84; + + /** + * Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + */ + NodeStakeUpdate = 85; + + /** + * Generate and return a pseudorandom number based on network state. + */ + UtilPrng = 86; + + /** + * Get a record for a "recent" transaction. + */ + TransactionGetFastRecord = 87 [deprecated = true]; + + /** + * Update the metadata of one or more NFT's of a specific token type. + */ + TokenUpdateNfts = 88; + + /** + * Create a node + */ + NodeCreate = 89; + + /** + * Update a node + */ + NodeUpdate = 90; + + /** + * Delete a node + */ + NodeDelete = 91; + + /** + * Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + */ + TokenReject = 92; + + /** + * Airdrop one or more tokens to one or more accounts. + */ + TokenAirdrop = 93; + + /** + * Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + */ + TokenCancelAirdrop = 94; + + /** + * Claim one or more pending airdrops + */ + TokenClaimAirdrop = 95; + + /** + * Submit a signature of a state root hash gossiped to other nodes + */ + StateSignatureTransaction = 100; + + /** + * Publish a hinTS key to the network. + */ + HintsKeyPublication = 101; + + /** + * Vote for a particular preprocessing output of a hinTS construction. + */ + HintsPreprocessingVote = 102; + + /** + * Sign a partial signature for the active hinTS construction. + */ + HintsPartialSignature = 103; + + /** + * Sign a particular history assembly. + */ + HistoryAssemblySignature = 104; + + /** + * Publish a roster history proof key to the network. + */ + HistoryProofKeyPublication = 105; + + /** + * Vote for a particular history proof. + */ + HistoryProofVote = 106; + + /** + * Publish a random CRS to the network. + */ + CrsPublication = 107; + + /** + * Submit a batch of transactions to run atomically + */ + AtomicBatch = 108; +} + +/** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ +message FeeComponents { + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + int64 min = 1; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + int64 max = 2; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + int64 constant = 3; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + int64 bpt = 4; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + int64 vpt = 5; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + int64 rbh = 6; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + int64 sbh = 7; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + int64 gas = 8; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + int64 tv = 9; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + int64 bpr = 10; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + int64 sbpr = 11; +} + +/** + * The fee schedule for a specific transaction or query based on the fee data. + */ +message TransactionFeeSchedule { + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + HederaFunctionality hederaFunctionality = 1; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + FeeData feeData = 2 [deprecated = true]; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + repeated FeeData fees = 3; +} + +/** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ +message FeeData { + /** + * Fee components to be paid to the submitting node. + */ + FeeComponents nodedata = 1; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + FeeComponents networkdata = 2; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + FeeComponents servicedata = 3; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + SubType subType = 4; +} + +/** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ +message FeeSchedule { + /** + * Sets of fee coefficients for various transaction or query types. + */ + repeated TransactionFeeSchedule transactionFeeSchedule = 1; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + TimestampSeconds expiryTime = 2; +} + +/** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ +message CurrentAndNextFeeSchedule { + /** + * A current, unexpired, fee schedule. + */ + FeeSchedule currentFeeSchedule = 1; + + /** + * A future fee schedule to use when the current schedule expires. + */ + FeeSchedule nextFeeSchedule = 2; +} + +/** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ +message ServiceEndpoint { + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + bytes ipAddressV4 = 1; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + int32 port = 2; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + string domain_name = 3; +} + +/** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ +message NodeAddress { + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + bytes ipAddress = 1 [deprecated = true]; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + int32 portno = 2 [deprecated = true]; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + bytes memo = 3 [deprecated = true]; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + string RSA_PubKey = 4; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + int64 nodeId = 5; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + AccountID nodeAccountId = 6; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + bytes nodeCertHash = 7; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + repeated ServiceEndpoint serviceEndpoint = 8; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + string description = 9; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + int64 stake = 10 [deprecated = true]; +} + +/** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ +message NodeAddressBook { + /** + * Published data for all nodes in the network + */ + repeated NodeAddress nodeAddress = 1; +} + +/** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ +message SemanticVersion { + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + int32 major = 1; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + int32 minor = 2; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + int32 patch = 3; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + string pre = 4; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + string build = 5; +} + +/** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ +message Setting { + /** + * A name for this setting property. + */ + string name = 1; + + /** + * A value for this setting property. + */ + string value = 2; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + bytes data = 3; +} + +/** + * Setting values representing a source of runtime configuration information. + */ +message ServicesConfigurationList { + /** + * A List of `Setting` values, typically read from application properties. + */ + repeated Setting nameValue = 1; +} + +/** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ +message TokenRelationship { + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + TokenID tokenId = 1; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + string symbol = 2; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + uint64 balance = 3; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + TokenKycStatus kycStatus = 4; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + TokenFreezeStatus freezeStatus = 5; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + uint32 decimals = 6; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + bool automatic_association = 7; +} + +/** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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 token identifier. + */ + TokenID tokenId = 1; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + uint64 balance = 2; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + uint32 decimals = 3; +} + +/** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ +message TokenBalances { + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + repeated TokenBalance tokenBalances = 1; +} + +/** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ +message TokenAssociation { + /** + * A token identifier for the associated token. + */ + TokenID token_id = 1; + + /** + * An account identifier for the associated account. + */ + AccountID account_id = 2; +} + +/** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ +message StakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + bool decline_reward = 1; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + Timestamp stake_period_start = 2; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + int64 pending_reward = 3; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + int64 staked_to_me = 4; + + oneof staked_id { + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + AccountID staked_account_id = 5; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + int64 staked_node_id = 6; + } +} + +/** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ +message PendingAirdropId { + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + AccountID sender_id = 1; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + AccountID receiver_id = 2; + + oneof token_reference { + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + TokenID fungible_token_type = 3; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + NftID non_fungible_token = 4; + } +} + +/** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ +message PendingAirdropValue { + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + uint64 amount = 1; +} + +/** + * A key to authorize transactions. + */ +message Key { + oneof key { + /** + * A smart contract instance that is authorized implicitly. + */ + ContractID contractID = 1; + + /** + * An array of Ed25519 public key bytes. + */ + bytes ed25519 = 2; + + /** + * This option is not currently supported. + * An array of RSA-3072 public key bytes. + */ + bytes RSA_3072 = 3 [deprecated = true]; + + /** + * This option is not currently supported. + * An array of ECDSA, using the p-384 curve, public key bytes. + */ + bytes ECDSA_384 = 4 [deprecated = true]; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + ThresholdKey thresholdKey = 5; + + /** + * A list of keys. + */ + KeyList keyList = 6; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes. + */ + bytes ECDSA_secp256k1 = 7; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization. + */ + ContractID delegatable_contract_id = 8; + } +} + +/** + * A threshold value and a list of public keys. + */ +message ThresholdKey { + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the keys list to be authorized by this key. + */ + uint32 threshold = 1; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + */ + KeyList keys = 2; +} + +/** + * A list of keys. + */ +message KeyList { + /** + * A list of keys. All values in this list SHALL be non-null. + */ + repeated Key keys = 1; +} diff --git a/packages/proto/minimal_src/consensus_create_topic.proto b/packages/proto/minimal_src/consensus_create_topic.proto new file mode 100644 index 0000000000..38dddc4fa1 --- /dev/null +++ b/packages/proto/minimal_src/consensus_create_topic.proto @@ -0,0 +1,44 @@ +/** + * # Consensus Create Topic + * Create a new consensus topic. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/** + * Create a new topic. + */ +message ConsensusCreateTopicTransactionBody { + /** + * Short publicly visible memo about the topic. + */ + string memo = 1; + + /** + * Access control for updateTopic/deleteTopic. + */ + Key adminKey = 2; + + /** + * Access control for submitMessage. + */ + Key submitKey = 3; + + /** + * The initial lifetime of the topic and the amount of time to extend the topic's lifetime by. + */ + Duration autoRenewPeriod = 6; + + /** + * An optional account to be used at the topic's expiration time to extend the life of the topic. + */ + AccountID autoRenewAccount = 7; +} diff --git a/packages/proto/minimal_src/consensus_create_topic_transaction.proto b/packages/proto/minimal_src/consensus_create_topic_transaction.proto new file mode 100644 index 0000000000..e62efd742f --- /dev/null +++ b/packages/proto/minimal_src/consensus_create_topic_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Consensus Create Topic Transaction + * Transaction for creating consensus topics. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "consensus_create_topic.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for consensus topic creation. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for consensus topic creation. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a topic. + */ + ConsensusCreateTopicTransactionBody consensusCreateTopic = 24; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/consensus_delete_topic.proto b/packages/proto/minimal_src/consensus_delete_topic.proto new file mode 100644 index 0000000000..d62f1e35b3 --- /dev/null +++ b/packages/proto/minimal_src/consensus_delete_topic.proto @@ -0,0 +1,24 @@ +/** + * # Consensus Delete Topic + * Delete a consensus topic. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Delete a topic. + */ +message ConsensusDeleteTopicTransactionBody { + /** + * Topic identifier. + */ + TopicID topicID = 1; +} + diff --git a/packages/proto/minimal_src/consensus_delete_topic_transaction.proto b/packages/proto/minimal_src/consensus_delete_topic_transaction.proto new file mode 100644 index 0000000000..68997186d7 --- /dev/null +++ b/packages/proto/minimal_src/consensus_delete_topic_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Consensus Delete Topic Transaction + * Transaction for deleting consensus topics. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "consensus_delete_topic.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for consensus topic deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for consensus topic deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a topic. + */ + ConsensusDeleteTopicTransactionBody consensusDeleteTopic = 26; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} diff --git a/packages/proto/minimal_src/consensus_submit_message.proto b/packages/proto/minimal_src/consensus_submit_message.proto new file mode 100644 index 0000000000..91378d4a6f --- /dev/null +++ b/packages/proto/minimal_src/consensus_submit_message.proto @@ -0,0 +1,54 @@ +/** + * # Consensus Submit Message + * Submit a message to a consensus topic. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Information about a chunk in a fragmented message. + */ +message ConsensusMessageChunkInfo { + /** + * The TransactionID of the first chunk. + */ + 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; +} + +/** + * Submit a message to a topic. + */ +message ConsensusSubmitMessageTransactionBody { + /** + * Topic to submit message to. + */ + TopicID topicID = 1; + + /** + * Message to be submitted. + */ + bytes message = 2; + + /** + * Optional information about the current chunk in a fragmented message. + */ + ConsensusMessageChunkInfo chunkInfo = 3; +} + diff --git a/packages/proto/minimal_src/consensus_submit_message_transaction.proto b/packages/proto/minimal_src/consensus_submit_message_transaction.proto new file mode 100644 index 0000000000..3860cae52b --- /dev/null +++ b/packages/proto/minimal_src/consensus_submit_message_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Consensus Submit Message Transaction + * Transaction for submitting messages to consensus topics. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "consensus_submit_message.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for consensus message submission. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for consensus message submission. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Submit a message to a topic. + */ + ConsensusSubmitMessageTransactionBody consensusSubmitMessage = 27; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/consensus_update_topic.proto b/packages/proto/minimal_src/consensus_update_topic.proto new file mode 100644 index 0000000000..7e8e128949 --- /dev/null +++ b/packages/proto/minimal_src/consensus_update_topic.proto @@ -0,0 +1,56 @@ +/** + * # Consensus Update Topic + * Update an existing consensus topic. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; + +/** + * Update a topic. + */ +message ConsensusUpdateTopicTransactionBody { + /** + * The topic to update. + */ + TopicID topicID = 1; + + /** + * Short publicly visible memo about the topic. + */ + string memo = 2; + + /** + * Effective consensus timestamp at (and after) which all consensus transactions and queries will expire. + */ + Timestamp expirationTime = 4; + + /** + * Access control for updateTopic/deleteTopic. + */ + Key adminKey = 6; + + /** + * Access control for submitMessage. + */ + Key submitKey = 7; + + /** + * The amount of time to extend the topic's lifetime automatically at expiration time. + */ + Duration autoRenewPeriod = 8; + + /** + * Optional account to be used at the topic's expiration time to extend the life of the topic. + */ + AccountID autoRenewAccount = 9; +} + diff --git a/packages/proto/minimal_src/consensus_update_topic_transaction.proto b/packages/proto/minimal_src/consensus_update_topic_transaction.proto new file mode 100644 index 0000000000..4204bef314 --- /dev/null +++ b/packages/proto/minimal_src/consensus_update_topic_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Consensus Update Topic Transaction + * Transaction for updating consensus topics. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "consensus_update_topic.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for consensus topic updates. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for consensus topic updates. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update a topic. + */ + ConsensusUpdateTopicTransactionBody consensusUpdateTopic = 25; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/contract_call.proto b/packages/proto/minimal_src/contract_call.proto new file mode 100644 index 0000000000..08069b6512 --- /dev/null +++ b/packages/proto/minimal_src/contract_call.proto @@ -0,0 +1,39 @@ +/** + * # Contract Call + * Transaction body for calls to a Smart Contract. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Call a function of a given smart contract. + */ +message ContractCallTransactionBody { + /** + * The ID of a smart contract to call. + */ + ContractID contractID = 1; + + /** + * A maximum limit to the amount of gas to use for this call. + */ + int64 gas = 2; + + /** + * Number of tinybars sent as the "value" for this call. + */ + int64 amount = 3; + + /** + * Which function to call, and the parameters to pass to the function. + */ + bytes functionParameters = 4; +} + diff --git a/packages/proto/minimal_src/contract_call_transaction.proto b/packages/proto/minimal_src/contract_call_transaction.proto new file mode 100644 index 0000000000..234a08d0b9 --- /dev/null +++ b/packages/proto/minimal_src/contract_call_transaction.proto @@ -0,0 +1,82 @@ +/** + * # Contract Call Transaction + * Transaction for calling smart contract functions. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "contract_call.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for contract calls. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for contract calls. + */ +message TransactionBody { + // <<>> This comment is special code for setting PBJ Compiler java package + reserved 30, 61, 62, 63, 64; + + reserved "tssMessage", "tssVote", "tssShareSignature", "tssEncryptionKey"; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Call a function defined on a smart contract. + */ + ContractCallTransactionBody contractCall = 7; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/contract_create.proto b/packages/proto/minimal_src/contract_create.proto new file mode 100644 index 0000000000..7bc5358099 --- /dev/null +++ b/packages/proto/minimal_src/contract_create.proto @@ -0,0 +1,102 @@ +/** + * # Smart Contract Create + * Create a new smart contract. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/** + * Create a new smart contract. + */ +message ContractCreateTransactionBody { + /** + * The file containing the bytecode for this contract. + */ + FileID fileID = 1; + + /** + * The admin key for this contract. + */ + Key adminKey = 3; + + /** + * Gas to be used for this contract creation. + */ + int64 gas = 4; + + /** + * Initial balance to be deposited into the contract. + */ + int64 initialBalance = 5; + + /** + * If the contract requires a proxy account, specify it here. + */ + AccountID proxyAccountID = 6 [deprecated = true]; + + /** + * The period that the instance will charge its account every this many seconds. + */ + Duration autoRenewPeriod = 8; + + /** + * The bytes that are the parameters to pass to the constructor. + */ + bytes constructorParameters = 9; + + /** + * The shard in which this contract is created. + */ + ShardID shardID = 10; + + /** + * The realm in which this contract is created. + */ + RealmID realmID = 11; + + /** + * If realmID is specified, then this the admin key for that realm. + */ + Key newRealmAdminKey = 12 [deprecated = true]; + + /** + * The memo associated with this contract. + */ + string memo = 13; + + /** + * The maximum number of tokens that this contract can be automatically associated with. + */ + int32 max_automatic_token_associations = 14; + + /** + * An account to charge for auto-renewal of this contract. + */ + AccountID auto_renew_account_id = 15; + + oneof staked_id { + /** + * ID of the account to which this contract is staking. + */ + AccountID staked_account_id = 16; + + /** + * ID of the node this contract is staked to. + */ + int64 staked_node_id = 17; + } + + /** + * If set to the sentinel value of -1, then this contract declines receiving a staking reward. + */ + bool decline_reward = 18; +} + diff --git a/packages/proto/minimal_src/contract_create_transaction.proto b/packages/proto/minimal_src/contract_create_transaction.proto new file mode 100644 index 0000000000..c041f45769 --- /dev/null +++ b/packages/proto/minimal_src/contract_create_transaction.proto @@ -0,0 +1,82 @@ +/** + * # Contract Create Transaction + * Transaction for creating new smart contracts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "contract_create.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for contract creation. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for contract creation. + */ +message TransactionBody { + // <<>> This comment is special code for setting PBJ Compiler java package + reserved 30, 61, 62, 63, 64; + + reserved "tssMessage", "tssVote", "tssShareSignature", "tssEncryptionKey"; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a smart contract. + */ + ContractCreateTransactionBody contractCreateInstance = 8; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/contract_delete.proto b/packages/proto/minimal_src/contract_delete.proto new file mode 100644 index 0000000000..f978836065 --- /dev/null +++ b/packages/proto/minimal_src/contract_delete.proto @@ -0,0 +1,41 @@ +/** + * # Contract Delete + * Delete a smart contract. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Mark a smart contract as deleted, and transfer its remaining hbars to another account. + */ +message ContractDeleteTransactionBody { + /** + * The contract to delete. + */ + ContractID contractID = 1; + + oneof obtainers { + /** + * The account to receive any remaining hbars from the deleted contract. + */ + AccountID transferAccountID = 2; + + /** + * The contract to receive any remaining hbars from the deleted contract. + */ + ContractID transferContractID = 3; + } + + /** + * If set to true, means this is a permanent deletion (versus an expiration). + */ + bool permanent_removal = 4; +} + diff --git a/packages/proto/minimal_src/contract_delete_transaction.proto b/packages/proto/minimal_src/contract_delete_transaction.proto new file mode 100644 index 0000000000..0929f58614 --- /dev/null +++ b/packages/proto/minimal_src/contract_delete_transaction.proto @@ -0,0 +1,82 @@ +/** + * # Contract Delete Transaction + * Transaction for deleting smart contracts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "contract_delete.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for contract deletion. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for contract deletion. + */ +message TransactionBody { + // <<>> This comment is special code for setting PBJ Compiler java package + reserved 30, 61, 62, 63, 64; + + reserved "tssMessage", "tssVote", "tssShareSignature", "tssEncryptionKey"; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a smart contract and transfer remaining balance to a specified account. + */ + ContractDeleteTransactionBody contractDeleteInstance = 10; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/contract_update.proto b/packages/proto/minimal_src/contract_update.proto new file mode 100644 index 0000000000..750940be40 --- /dev/null +++ b/packages/proto/minimal_src/contract_update.proto @@ -0,0 +1,82 @@ +/** + * # Contract Update + * Update a smart contract. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/** + * Modify a smart contract. + */ +message ContractUpdateTransactionBody { + /** + * The Contract ID of the contract to update. + */ + ContractID contractID = 1; + + /** + * The expiration time to extend to (the amount to extend the current expiration time). + */ + Timestamp expirationTime = 2; + + /** + * The new admin key for this contract. + */ + Key adminKey = 3; + + /** + * An account that is charged for auto-renewal of this contract. + */ + AccountID proxyAccountID = 6 [deprecated = true]; + + /** + * The auto renew period for this contract. + */ + Duration autoRenewPeriod = 7; + + /** + * The new file ID of the bytecode to update the contract with. + */ + FileID fileID = 8; + + /** + * The new contract memo, assumed to be Unicode encoded with UTF-8. + */ + string memo = 9; + + /** + * The maximum number of tokens that this contract can be automatically associated with. + */ + int32 max_automatic_token_associations = 10; + + /** + * An account to charge for auto-renewal of this contract. + */ + AccountID auto_renew_account_id = 11; + + oneof staked_id { + /** + * ID of the account to which this contract is staking. + */ + AccountID staked_account_id = 12; + + /** + * ID of the node this contract is staked to. + */ + int64 staked_node_id = 13; + } + + /** + * If set to the sentinel value of -1, then this contract declines receiving a staking reward. + */ + bool decline_reward = 14; +} + diff --git a/packages/proto/minimal_src/contract_update_transaction.proto b/packages/proto/minimal_src/contract_update_transaction.proto new file mode 100644 index 0000000000..426e2d9d48 --- /dev/null +++ b/packages/proto/minimal_src/contract_update_transaction.proto @@ -0,0 +1,82 @@ +/** + * # Contract Update Transaction + * Transaction for updating smart contracts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "contract_update.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for contract updates. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for contract updates. + */ +message TransactionBody { + // <<>> This comment is special code for setting PBJ Compiler java package + reserved 30, 61, 62, 63, 64; + + reserved "tssMessage", "tssVote", "tssShareSignature", "tssEncryptionKey"; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update a smart contract. + */ + ContractUpdateTransactionBody contractUpdateInstance = 9; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_approve_allowance.proto b/packages/proto/minimal_src/crypto_approve_allowance.proto new file mode 100644 index 0000000000..895c080ba6 --- /dev/null +++ b/packages/proto/minimal_src/crypto_approve_allowance.proto @@ -0,0 +1,114 @@ +/** + * # Crypto Approve Allowance + * Approve allowances for spenders to transfer HBAR or tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Creates one or more hbar/token approved allowances. + */ +message CryptoApproveAllowanceTransactionBody { + /** + * List of hbar allowances approved by the account owner. + */ + repeated CryptoAllowance cryptoAllowances = 1; + + /** + * List of NFT allowances approved by the account owner. + */ + repeated NftAllowance nftAllowances = 2; + + /** + * List of fungible token allowances approved by the account owner. + */ + repeated TokenAllowance tokenAllowances = 3; +} + +/** + * An approved allowance of hbar transfers for a spender. + */ +message CryptoAllowance { + /** + * The account that owns the hbar. + */ + AccountID owner = 1; + + /** + * The account authorized to spend the hbar. + */ + AccountID spender = 2; + + /** + * The amount of hbar authorized to be spent by the spender. + */ + int64 amount = 3; +} + +/** + * An approved allowance of NFT transfers for a spender. + */ +message NftAllowance { + /** + * The account that owns the NFT. + */ + AccountID owner = 1; + + /** + * The account authorized to spend the NFT. + */ + AccountID spender = 2; + + /** + * The token that the allowance pertains to. + */ + TokenID tokenId = 3; + + /** + * List of serial numbers that the spender is authorized to transfer. + */ + repeated int64 serialNumbers = 4; + + /** + * If true, the spender has access to all of the owner's NFT units. + */ + bool approvedForAll = 5; + + /** + * The account that should be charged the fee for the current allowance. + */ + AccountID delegatingSpender = 6; +} + +/** + * An approved allowance of fungible token transfers for a spender. + */ +message TokenAllowance { + /** + * The account that owns the tokens. + */ + AccountID owner = 1; + + /** + * The account authorized to spend the tokens. + */ + AccountID spender = 2; + + /** + * The amount of tokens that the spender is authorized to spend. + */ + int64 amount = 3; + + /** + * The token that the allowance pertains to. + */ + TokenID tokenId = 4; +} + diff --git a/packages/proto/minimal_src/crypto_approve_allowance_transaction.proto b/packages/proto/minimal_src/crypto_approve_allowance_transaction.proto new file mode 100644 index 0000000000..a9bf1b94f3 --- /dev/null +++ b/packages/proto/minimal_src/crypto_approve_allowance_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Crypto Approve Allowance Transaction + * Transaction for approving allowances for spenders. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "crypto_approve_allowance.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for crypto allowance approval. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto allowance approval. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Add one or more approved allowances for spenders. + */ + CryptoApproveAllowanceTransactionBody cryptoApproveAllowance = 37; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_create.proto b/packages/proto/minimal_src/crypto_create.proto new file mode 100644 index 0000000000..03ff93895b --- /dev/null +++ b/packages/proto/minimal_src/crypto_create.proto @@ -0,0 +1,201 @@ +/** + * # Crypto Create + * Messages to create a new end-user account within the distributed ledger. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; + +/* + * Create a new account. + * + * If the auto_renew_account field is set, the key of the referenced account + * MUST sign this transaction.
+ * Current limitations REQUIRE that `shardID` and `realmID` both MUST be `0`. + * This is expected to change in the future. + * + * ### Block Stream Effects + * The newly created account SHALL be included in State Changes. + */ +message CryptoCreateTransactionBody { + // Removed prior to oldest available history + reserved 4,5; + + /** + * The identifying key for this account. + * This key represents the account owner, and is required for most actions + * involving this account that do not modify the account itself. This key + * may also identify the account for smart contracts. + *

+ * This field is REQUIRED. + * This `Key` MUST NOT be an empty `KeyList` and MUST contain at least one + * "primitive" (i.e. cryptographic) key value. + */ + Key key = 1; + + /** + * An amount, in tinybar, to deposit to the newly created account. + *

+ * The deposited amount SHALL be debited to the "payer" account for this + * transaction. + */ + uint64 initialBalance = 2; + + /** + * Use `staked_id` instead.
+ * An account identifier for a staking proxy. + */ + AccountID proxyAccountID = 3 [deprecated = true]; + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that reduces this account balance. + */ + uint64 sendRecordThreshold = 6 [deprecated = true]; + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that increases this account balance. + */ + uint64 receiveRecordThreshold = 7 [deprecated = true]; + + /** + * A flag indicating the account holder must authorize all incoming + * token transfers. + *

+ * If this flag is set then any transaction that would result in adding + * hbar or other tokens to this account balance MUST be signed by the + * identifying key of this account (that is, the `key` field).
+ * If this flag is set, then the account key (`key` field) MUST sign + * this create transaction, in addition to the transaction payer. + */ + bool receiverSigRequired = 8; + + /** + * The duration between account automatic renewals.
+ * All entities in state may be charged "rent" occasionally (typically + * every 90 days) to prevent unnecessary growth of the ledger. This value + * sets the interval between such events for this account. + *

+ * If the account balance (in HBAR) is insufficient to pay the full renewal + * fee, the entire HBAR balance SHALL be consumed and the expiration for + * the account SHALL be extended as far as the available balance can + * support.
+ * If the account HBAR balance is `0` when the account must be renewed, then + * the account SHALL be deleted, and subsequently removed from state. + */ + Duration autoRenewPeriod = 9; + + /** + * The shard in which this account is created + *

+ * Currently, this MUST be `0`.
+ * If the desired shard is `0`, this SHOULD NOT be set. + */ + ShardID shardID = 10; + + /** + * The realm in which this account is created. + *

+ * The shard number for this realm MUST match the value in `shardID`.
+ * Currently, this MUST be `0` for both fields.
+ * If the desired realm is `0`, this SHOULD NOT be set. + */ + RealmID realmID = 11; + + /** + * This field was never actually used or enabled, and is not expected to + * ever be used in the future.
+ */ + Key newRealmAdminKey = 12 [deprecated = true]; + + /** + * A short description of this Account. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + string memo = 13; + + /** + * A maximum number of tokens that can be auto-associated + * with this account.
+ * By default this value is 0 for all accounts except for automatically + * created accounts (e.g. smart contracts), which default to -1. + *

+ * If this value is `0`, then this account MUST manually associate to + * a token before holding or transacting in that token.
+ * This value MAY also be `-1` to indicate no limit.
+ * This value MUST NOT be less than `-1`. + */ + int32 max_automatic_token_associations = 14; + + oneof staked_id { + /** + * ID of the account to which this account is staking its balances. + *

+ * If this account is not currently staking its balances, then this + * field, if set, MUST be the sentinel value of `0.0.0`. + */ + AccountID staked_account_id = 15; + + /** + * ID of the node this account is staked to. + *

+ * If this account is not currently staking its balances, then this + * field, if set, SHALL be the sentinel value of `-1`.
+ * Wallet software SHOULD surface staking issues to users and provide a + * simple mechanism to update staking to a new node ID in the event the + * prior staked node ID ceases to be valid. + */ + int64 staked_node_id = 16; + } + + /** + * A boolean indicating that this account has chosen to decline rewards for + * staking its balances. + *

+ * This account MAY still stake its balances, but SHALL NOT receive reward + * payments for doing so, if this value is set. + */ + bool decline_reward = 17; + + /** + * Bytes to be used as the account's alias. + *

+ * This value, if set, MUST be one of the following values
+ *

+ * All aliases within the network MUST be unique. If this value matches an + * existing account alias, this `create` transaction SHALL fail.
+ * If an account exists with a particular alias value, any transaction to + * transfer value _to_ that alias SHALL deposit the transferred value in + * the existing account, and SHALL NOT assess an account creation fee.
+ * Once set, an account alias is immutable and MUST NOT be changed. + */ + bytes alias = 18; +} diff --git a/packages/proto/minimal_src/crypto_create_transaction.proto b/packages/proto/minimal_src/crypto_create_transaction.proto new file mode 100644 index 0000000000..fc614adac5 --- /dev/null +++ b/packages/proto/minimal_src/crypto_create_transaction.proto @@ -0,0 +1,112 @@ +/** + * # Crypto Create Transaction + * Transaction for creating new Hedera accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "crypto_create.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for crypto account creation. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * Replaced with `signedTransactionBytes`. + * The body of the transaction. + */ + TransactionBody body = 1 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body. + */ + SignatureList sigs = 2 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body with a newer format. + */ + SignatureMap sigMap = 3 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`. + * TransactionBody serialized into bytes. + */ + bytes bodyBytes = 4 [deprecated = true]; + + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto account creation. + */ +message TransactionBody { + // <<>> This comment is special code for setting PBJ Compiler java package + reserved 30, 61, 62, 63, 64; + + reserved "tssMessage", "tssVote", "tssShareSignature", "tssEncryptionKey"; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * Records are always generated. + * Obsolete option to not generate a record. + */ + bool generateRecord = 5 [deprecated = true]; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a new Hedera account. + */ + CryptoCreateTransactionBody cryptoCreateAccount = 11; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_delete.proto b/packages/proto/minimal_src/crypto_delete.proto new file mode 100644 index 0000000000..ca39e1dc1e --- /dev/null +++ b/packages/proto/minimal_src/crypto_delete.proto @@ -0,0 +1,29 @@ +/** + * # Crypto Delete + * Delete a Hedera account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Mark an account as deleted, transferring its current hbar balance to another account. + */ +message CryptoDeleteTransactionBody { + /** + * The account ID to receive any remaining hbars from the deleted account. + */ + AccountID transferAccountID = 1; + + /** + * The account ID to delete. + */ + AccountID deleteAccountID = 2; +} + diff --git a/packages/proto/minimal_src/crypto_delete_allowance.proto b/packages/proto/minimal_src/crypto_delete_allowance.proto new file mode 100644 index 0000000000..b3b1ae2a2a --- /dev/null +++ b/packages/proto/minimal_src/crypto_delete_allowance.proto @@ -0,0 +1,44 @@ +/** + * # Crypto Delete Allowance + * Delete allowances for spenders to transfer HBAR or tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Deletes one or more non-fungible approved allowances from an owner's account. + */ +message CryptoDeleteAllowanceTransactionBody { + /** + * List of NFT allowances to be deleted. + */ + repeated NftRemoveAllowance nftAllowances = 1; +} + +/** + * Nft allowance to be removed on an owner account. + */ +message NftRemoveAllowance { + /** + * The token that the allowance pertains to. + */ + TokenID token_id = 1; + + /** + * The account that owns the NFT. + */ + AccountID owner = 2; + + /** + * List of serial numbers to remove allowances from. + */ + repeated int64 serial_numbers = 3; +} + diff --git a/packages/proto/minimal_src/crypto_delete_allowance_transaction.proto b/packages/proto/minimal_src/crypto_delete_allowance_transaction.proto new file mode 100644 index 0000000000..3afc67e8b1 --- /dev/null +++ b/packages/proto/minimal_src/crypto_delete_allowance_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Crypto Delete Allowance Transaction + * Transaction for deleting allowances for spenders. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "crypto_delete_allowance.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for crypto allowance deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto allowance deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete one or more approvals for spenders. + */ + CryptoDeleteAllowanceTransactionBody cryptoDeleteAllowance = 38; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_delete_transaction.proto b/packages/proto/minimal_src/crypto_delete_transaction.proto new file mode 100644 index 0000000000..6e59eda13e --- /dev/null +++ b/packages/proto/minimal_src/crypto_delete_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Crypto Delete Transaction + * Transaction for deleting Hedera accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "crypto_delete.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for crypto account deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto account deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete an Hedera account. + */ + CryptoDeleteTransactionBody cryptoDelete = 8; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_transfer.proto b/packages/proto/minimal_src/crypto_transfer.proto new file mode 100644 index 0000000000..f82c756a40 --- /dev/null +++ b/packages/proto/minimal_src/crypto_transfer.proto @@ -0,0 +1,81 @@ +/** + * # Crypto Transfer + * Transaction to transfer HBAR between accounts, or between accounts and + * smart contracts. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +import "services/basic_types.proto"; + +/** + * Transfer HBAR and/or other tokens among two or more accounts and/or smart + * contracts. + * + * Transfers of HBAR or fungible/common tokens in this transaction are + * structured as a "double-entry" transfer list which debits one or more + * accounts, and separately credits one or more accounts. Each such transfer + * list may specify up to 10 individual credits or debits.
+ * Transfers of non-fungible/unique tokens in this transaction are + * structured as a "single-entry" transfer list, which both debits one account + * and credits another account in a single entry. + * + * At least one transfer MUST be present, this MAY be an HBAR transfer in + * `transfers`, or MAY be a token transfer in `tokenTransfers`.
+ * Either `transfers` or `tokenTransfers` MAY be unset, provided the other + * is set and not empty.
+ * If any one account with a debit in any transfer list holds insufficient + * balance to complete the transfer, the entire transaction SHALL fail, and + * all transfers SHALL NOT be completed.
+ * If any one account that is _sending_ an individual non-fungible/unique (NFT) + * token does not currently hold that unique NFT, the entire transaction SHALL + * FAIL, and all transfers SHALL NOT be completed. + * The transaction fee SHALL be charged for a transaction that fails due to + * insufficient balance or not holding the NFT to be transferred.
+ * Each account with any debit amounts in any transfer list MUST sign this + * transaction.
+ * Each account with any credit amounts in any transfer list that also has the + * `receiverSigRequired` flag set MUST sign this transaction. + * + * ### Block Stream Effects + * All debits and credits completed by this transaction SHALL be included in + * the transaction result transfer list.
+ * Multiple fungible/common debits from one account, or credits to one account, + * MAY be consolidated to a single debit or credit entry in the + * transaction result.
+ * Multiple non-fungible/unique transfers SHALL NOT be consolidated in the + * transaction result. + */ +message CryptoTransferTransactionBody { + /** + * A list of HBAR transfers. + *

+ * Each transfer in this list MUST be denominated in tinybar. + */ + TransferList transfers = 1; + + /** + * One or more lists of token transfers. + *

+ * This list MUST NOT contain more than 10 entries.
+ * If custom fees must be charged, the fee SHALL be assessed against the + * effective "payer" for this transaction.
+ * If the effective "payer" for this transaction lacks sufficient balance + * to pay custom fees assessed, the entire transaction SHALL fail with a + * response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`. + */ + repeated TokenTransferList tokenTransfers = 2; +} diff --git a/packages/proto/minimal_src/crypto_transfer_transaction.proto b/packages/proto/minimal_src/crypto_transfer_transaction.proto new file mode 100644 index 0000000000..d97e1ffd5e --- /dev/null +++ b/packages/proto/minimal_src/crypto_transfer_transaction.proto @@ -0,0 +1,81 @@ +/** + * # Crypto Transfer Transaction + * Transaction for transferring HBAR and tokens between accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "custom_fees.proto"; +import "duration.proto"; +import "basic_types.proto"; +import "timestamp.proto"; +import "crypto_transfer.proto"; + + +/** + * A wrapper around signed transaction bytes for crypto transfers. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto transfers. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Transfer HBAR between accounts. + */ + CryptoTransferTransactionBody cryptoTransfer = 14; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/crypto_update.proto b/packages/proto/minimal_src/crypto_update.proto new file mode 100644 index 0000000000..b381c35e00 --- /dev/null +++ b/packages/proto/minimal_src/crypto_update.proto @@ -0,0 +1,78 @@ +/** + * # Crypto Update + * Update a Hedera account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; + +/** + * Change properties for the given account. + */ +message CryptoUpdateTransactionBody { + /** + * The account ID to update. + */ + AccountID accountIDToUpdate = 2; + + /** + * The new key for the account. + */ + Key key = 3; + + /** + * Use staked_id instead. + */ + AccountID proxyAccountID = 4 [deprecated = true]; + + /** + * The new expiry time for the account. + */ + Timestamp expirationTime = 6; + + /** + * The new period that the account will be charged. + */ + Duration autoRenewPeriod = 7; + + /** + * If set to the sentinel value of 0.0.0, this field removes the account's receiver signature requirement. + */ + bool receiverSigRequiredWrapper = 8 [deprecated = true]; + + /** + * If set, the new memo to be associated with the account. + */ + string memo = 9; + + /** + * The maximum number of tokens that this account can be automatically associated with. + */ + int32 max_automatic_token_associations = 10; + + oneof staked_id { + /** + * ID of the account to which this account is staking. + */ + AccountID staked_account_id = 11; + + /** + * ID of the node this account is staked to. + */ + int64 staked_node_id = 12; + } + + /** + * If true, the account declines receiving a staking reward. + */ + bool decline_reward = 13; +} + diff --git a/packages/proto/minimal_src/crypto_update_transaction.proto b/packages/proto/minimal_src/crypto_update_transaction.proto new file mode 100644 index 0000000000..a324bc80a2 --- /dev/null +++ b/packages/proto/minimal_src/crypto_update_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Crypto Update Transaction + * Transaction for updating Hedera accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "crypto_update.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for crypto account updates. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for crypto account updates. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Modify an Hedera account. + */ + CryptoUpdateTransactionBody cryptoUpdateAccount = 10; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/custom_fees.proto b/packages/proto/minimal_src/custom_fees.proto new file mode 100644 index 0000000000..3ef287a838 --- /dev/null +++ b/packages/proto/minimal_src/custom_fees.proto @@ -0,0 +1,407 @@ +/** + * # Custom Fees + * Fees defined by token creators that are charged as part of each + * transfer of that token type. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ +message FractionalFee { + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + Fraction fractional_amount = 1; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + int64 minimum_amount = 2; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + int64 maximum_amount = 3; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + bool net_of_transfers = 4; +} + +/** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ +message FixedFee { + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + int64 amount = 1; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + TokenID denominating_token_id = 2; +} + +/** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ +message RoyaltyFee { + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + Fraction exchange_value_fraction = 1; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + FixedFee fallback_fee = 2; +} + +/** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ +message CustomFee { + oneof fee { + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + FixedFee fixed_fee = 1; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + FractionalFee fractional_fee = 2; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + RoyaltyFee royalty_fee = 4; + + } + /** + * The account to receive the custom fee. + */ + AccountID fee_collector_account_id = 3; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + bool all_collectors_are_exempt = 5; +} + +/** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ +message AssessedCustomFee { + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + int64 amount = 1; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + TokenID token_id = 2; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + AccountID fee_collector_account_id = 3; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + repeated AccountID effective_payer_account_id = 4; +} + +/** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ +message FixedCustomFee { + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + FixedFee fixed_fee = 1; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + AccountID fee_collector_account_id = 2; +} + +/** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ +message FixedCustomFeeList { + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + repeated FixedCustomFee fees = 1; +} + +/** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ +message FeeExemptKeyList { + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + repeated Key keys = 1; +} + +/** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ +message CustomFeeLimit { + /** + * A payer account identifier. + */ + AccountID account_id = 1; + + /** + * The maximum fees that the user is willing to pay for the message. + */ + repeated FixedFee fees = 2; +} diff --git a/packages/proto/minimal_src/duration.proto b/packages/proto/minimal_src/duration.proto new file mode 100644 index 0000000000..8a0a618388 --- /dev/null +++ b/packages/proto/minimal_src/duration.proto @@ -0,0 +1,32 @@ +/** + * # Duration + * A duration, in seconds. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +/** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ +message Duration { + /** + * The number of seconds for this duration. + */ + int64 seconds = 1; +} diff --git a/packages/proto/minimal_src/ethereum_transaction_transaction.proto b/packages/proto/minimal_src/ethereum_transaction_transaction.proto new file mode 100644 index 0000000000..89e59f8382 --- /dev/null +++ b/packages/proto/minimal_src/ethereum_transaction_transaction.proto @@ -0,0 +1,98 @@ +/** + * # Ethereum Transaction + * Transaction for Ethereum-format transactions. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for Ethereum transactions. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction in Ethereum format. + */ +message EthereumTransactionBody { + /** + * The raw Ethereum transaction data. + */ + bytes ethereum_data = 1; + + /** + * The callData for the Ethereum transaction. + */ + FileID call_data = 2; + + /** + * A maximum amount of gas offered to pay the Ethereum transaction costs. + */ + int64 max_gas_allowance = 3; +} + +/** + * A transaction body for Ethereum transactions. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Perform an Ethereum encoded transaction. + */ + EthereumTransactionBody ethereumTransaction = 50; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/file_append.proto b/packages/proto/minimal_src/file_append.proto new file mode 100644 index 0000000000..ae699af34a --- /dev/null +++ b/packages/proto/minimal_src/file_append.proto @@ -0,0 +1,29 @@ +/** + * # File Append Transaction + * Transaction for appending data to files. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Append the given contents to the end of the specified file. + */ +message FileAppendTransactionBody { + /** + * The file ID to append to. + */ + FileID fileID = 2; + + /** + * The bytes to append to the contents of the file. + */ + bytes contents = 4; +} + diff --git a/packages/proto/minimal_src/file_append_transaction.proto b/packages/proto/minimal_src/file_append_transaction.proto new file mode 100644 index 0000000000..750a1e407b --- /dev/null +++ b/packages/proto/minimal_src/file_append_transaction.proto @@ -0,0 +1,118 @@ +/** + * # File Append Transaction + * Transaction for appending data to files. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; +import "file_append.proto"; + +/** + * A wrapper around signed transaction bytes.
+ * This was originally a transaction with body, signatures, and/or bytes, + * but is not only a wrapper around a byte array containing signed transction + * bytes. + * + * The `signedTransactionBytes` field is REQUIRED and MUST contain a valid, + * serialized, `SignedTransaction` message.
+ * All other fields are deprecated and MUST NOT be set. + * + * #### Additional Notes + * The four deprecated fields will be removed and reserved in a future release. + */ +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + TransactionBody body = 1 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + SignatureList sigs = 2 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + SignatureMap sigMap = 3 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + bytes bodyBytes = 4 [deprecated = true]; + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for file append. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Append data to the end of a file. + */ + FileAppendTransactionBody fileAppend = 16; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/file_create.proto b/packages/proto/minimal_src/file_create.proto new file mode 100644 index 0000000000..e254f09ec8 --- /dev/null +++ b/packages/proto/minimal_src/file_create.proto @@ -0,0 +1,55 @@ +/** + * # File Create + * Create a new file. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; + +/** + * Create a new file. + */ +message FileCreateTransactionBody { + /** + * The time at which this file should expire. + */ + Timestamp expirationTime = 2; + + /** + * All keys at the top level of a key list must sign to create or modify 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 this file is created. + */ + RealmID realmID = 6; + + /** + * If realmID is specified, then this the admin key for that realm. + */ + Key newRealmAdminKey = 7 [deprecated = true]; + + /** + * The memo associated with the file. + */ + string memo = 8; +} + diff --git a/packages/proto/minimal_src/file_create_transaction.proto b/packages/proto/minimal_src/file_create_transaction.proto new file mode 100644 index 0000000000..911dd10c16 --- /dev/null +++ b/packages/proto/minimal_src/file_create_transaction.proto @@ -0,0 +1,78 @@ +/** + * # File Create Transaction + * Transaction for creating new files. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "file_create.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for file creation. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for file creation. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a new file. + */ + FileCreateTransactionBody fileCreate = 17; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/file_delete.proto b/packages/proto/minimal_src/file_delete.proto new file mode 100644 index 0000000000..a4104e2101 --- /dev/null +++ b/packages/proto/minimal_src/file_delete.proto @@ -0,0 +1,24 @@ +/** + * # File Delete + * Delete a file. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Mark a file as deleted. + */ +message FileDeleteTransactionBody { + /** + * The file to delete. + */ + FileID fileID = 2; +} + diff --git a/packages/proto/minimal_src/file_delete_transaction.proto b/packages/proto/minimal_src/file_delete_transaction.proto new file mode 100644 index 0000000000..c21c094972 --- /dev/null +++ b/packages/proto/minimal_src/file_delete_transaction.proto @@ -0,0 +1,78 @@ +/** + * # File Delete Transaction + * Transaction for deleting files. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "file_delete.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for file deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for file deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a file. + */ + FileDeleteTransactionBody fileDelete = 18; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/file_update.proto b/packages/proto/minimal_src/file_update.proto new file mode 100644 index 0000000000..e7f46a827b --- /dev/null +++ b/packages/proto/minimal_src/file_update.proto @@ -0,0 +1,45 @@ +/** + * # File Update + * Modify a file. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; + +/** + * Modify the metadata and/or contents of a file. + */ +message FileUpdateTransactionBody { + /** + * The ID of the file to update. + */ + FileID fileID = 1; + + /** + * The new expiry time. + */ + Timestamp expirationTime = 2; + + /** + * The new list of keys that can modify or delete this 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. + */ + string memo = 5; +} + diff --git a/packages/proto/minimal_src/file_update_transaction.proto b/packages/proto/minimal_src/file_update_transaction.proto new file mode 100644 index 0000000000..226e691167 --- /dev/null +++ b/packages/proto/minimal_src/file_update_transaction.proto @@ -0,0 +1,78 @@ +/** + * # File Update Transaction + * Transaction for updating files. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "file_update.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for file updates. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for file updates. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Modify a file. + */ + FileUpdateTransactionBody fileUpdate = 19; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/freeze_transaction.proto b/packages/proto/minimal_src/freeze_transaction.proto new file mode 100644 index 0000000000..dd7e3f8ff1 --- /dev/null +++ b/packages/proto/minimal_src/freeze_transaction.proto @@ -0,0 +1,139 @@ +/** + * # Freeze Transaction + * Transaction for freezing the network. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for freeze. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * The type of freeze. + */ +enum FreezeType { + /** + * An (invalid) default value for this enum. + */ + UNKNOWN_FREEZE_TYPE = 0; + + /** + * Freezes the network at the specified time. + */ + FREEZE_ONLY = 1; + + /** + * Prepares the network for a software upgrade. + */ + PREPARE_UPGRADE = 2; + + /** + * Freezes the network and upgrades software. + */ + FREEZE_UPGRADE = 3; + + /** + * Aborts a pending network freeze. + */ + FREEZE_ABORT = 4; + + /** + * Upgrades telemetry. + */ + TELEMETRY_UPGRADE = 5; +} + +/** + * A transaction body for all freeze transactions. + */ +message FreezeTransactionBody { + /** + * An upgrade file. + */ + FileID update_file = 5; + + /** + * A SHA384 hash of file content. + */ + bytes file_hash = 6; + + /** + * A start time for the freeze. + */ + Timestamp start_time = 7; + + /** + * The type of freeze. + */ + FreezeType freeze_type = 8; +} + +/** + * A transaction body for freeze. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Freeze the network. + */ + FreezeTransactionBody freeze = 23; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/google_protobuf_wrappers.proto b/packages/proto/minimal_src/google_protobuf_wrappers.proto new file mode 100644 index 0000000000..541e0e1f18 --- /dev/null +++ b/packages/proto/minimal_src/google_protobuf_wrappers.proto @@ -0,0 +1,101 @@ +/** + * # Google Protobuf Wrappers + * Standard wrapper types from google/protobuf/wrappers.proto + */ +syntax = "proto3"; + +package google.protobuf; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.google.protobuf"; +option java_multiple_files = true; + +/** + * Wrapper message for `uint32`. + */ +message UInt32Value { + /** + * The uint32 value. + */ + uint32 value = 1; +} + +/** + * Wrapper message for `string`. + */ +message StringValue { + /** + * The string value. + */ + string value = 1; +} + +/** + * Wrapper message for `bool`. + */ +message BoolValue { + /** + * The bool value. + */ + bool value = 1; +} + +/** + * Wrapper message for `bytes`. + */ +message BytesValue { + /** + * The bytes value. + */ + bytes value = 1; +} + +/** + * Wrapper message for `uint64`. + */ +message UInt64Value { + /** + * The uint64 value. + */ + uint64 value = 1; +} + +/** + * Wrapper message for `int32`. + */ +message Int32Value { + /** + * The int32 value. + */ + int32 value = 1; +} + +/** + * Wrapper message for `int64`. + */ +message Int64Value { + /** + * The int64 value. + */ + int64 value = 1; +} + +/** + * Wrapper message for `float`. + */ +message FloatValue { + /** + * The float value. + */ + float value = 1; +} + +/** + * Wrapper message for `double`. + */ +message DoubleValue { + /** + * The double value. + */ + double value = 1; +} diff --git a/packages/proto/minimal_src/node_create_transaction.proto b/packages/proto/minimal_src/node_create_transaction.proto new file mode 100644 index 0000000000..48786afd0b --- /dev/null +++ b/packages/proto/minimal_src/node_create_transaction.proto @@ -0,0 +1,128 @@ +/** + * # Node Create Transaction + * Transaction for creating new consensus nodes. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for node create. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body to add a new consensus node to the network address book. + */ +message NodeCreateTransactionBody { + /** + * A Node account identifier. + */ + AccountID account_id = 1; + + /** + * A short description of the node. + */ + string description = 2; + + /** + * A list of service endpoints for gossip. + */ + repeated ServiceEndpoint gossip_endpoint = 3; + + /** + * A list of service endpoints for gRPC calls. + */ + repeated ServiceEndpoint service_endpoint = 4; + + /** + * A certificate used to sign gossip events. + */ + bytes gossip_ca_certificate = 5; + + /** + * A hash of the node gRPC TLS certificate. + */ + bytes grpc_certificate_hash = 6; + + /** + * An administrative key controlled by the node operator. + */ + Key admin_key = 7; + + /** + * A boolean flag indicating whether the node operator declines to receive node rewards. + */ + bool decline_reward = 8; + + /** + * A web proxy for gRPC from non-gRPC clients. + */ + ServiceEndpoint grpc_proxy_endpoint = 9; +} + +/** + * A transaction body for node create. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a new node in the network address book. + */ + NodeCreateTransactionBody nodeCreate = 54; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/node_delete_transaction.proto b/packages/proto/minimal_src/node_delete_transaction.proto new file mode 100644 index 0000000000..107958d0ee --- /dev/null +++ b/packages/proto/minimal_src/node_delete_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Node Delete Transaction + * Transaction for deleting consensus nodes from the network address book. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for node delete. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body to delete a node from the network address book. + */ +message NodeDeleteTransactionBody { + /** + * A consensus node identifier in the network state. + */ + uint64 node_id = 1; +} + +/** + * A transaction body for node delete. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a node from the network address book. + */ + NodeDeleteTransactionBody nodeDelete = 56; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/node_stake_update_transaction.proto b/packages/proto/minimal_src/node_stake_update_transaction.proto new file mode 100644 index 0000000000..195f352b7d --- /dev/null +++ b/packages/proto/minimal_src/node_stake_update_transaction.proto @@ -0,0 +1,189 @@ +/** + * # Node Stake Update Transaction + * Transaction for updating stake information for nodes. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for node stake update. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Staking information for one node at the end of a staking period. + */ +message NodeStake { + /** + * A limit to the amount of stake considered for consensus weight. + */ + int64 max_stake = 1; + + /** + * A minimum amount of HBAR staked to a node to receive rewards. + */ + int64 min_stake = 2; + + /** + * A node identifier. + */ + int64 node_id = 3; + + /** + * The rate of rewards, in tinybar per HBAR. + */ + int64 reward_rate = 4; + + /** + * A consensus weight assigned to this node for the next staking period. + */ + int64 stake = 5; + + /** + * The total amount staked to this node, while declining rewards. + */ + int64 stake_not_rewarded = 6; + + /** + * The total amount staked to this node, while accepting rewards. + */ + int64 stake_rewarded = 7; +} + +/** + * A system initiated transaction to update staking information. + */ +message NodeStakeUpdateTransactionBody { + /** + * A timestamp indicating the end of the staking period. + */ + Timestamp end_of_staking_period = 1; + + /** + * A list of NodeStake entries for each node. + */ + repeated NodeStake node_stake = 2; + + /** + * A maximum reward rate for this staking period. + */ + int64 max_staking_reward_rate_per_hbar = 3; + + /** + * A fraction of network and service fees paid to the node reward account. + */ + Fraction node_reward_fee_fraction = 4; + + /** + * A limit to the number of staking periods held for inactive accounts. + */ + int64 staking_periods_stored = 5; + + /** + * A number of minutes representing a staking period. + */ + int64 staking_period = 6; + + /** + * A fraction of network and service fees paid to the general reward account. + */ + Fraction staking_reward_fee_fraction = 7; + + /** + * A minimum balance required to pay general staking rewards. + */ + int64 staking_start_threshold = 8; + + /** + * An amount reserved in the staking reward account. + */ + int64 reserved_staking_rewards = 10; + + /** + * An available, unreserved, amount in the staking reward account. + */ + int64 unreserved_staking_reward_balance = 11; + + /** + * A minimum balance required for maximum staking rewards. + */ + int64 reward_balance_threshold = 12; + + /** + * A maximum network-wide stake that can earn full rewards. + */ + int64 max_stake_rewarded = 13; + + /** + * A limit amount that could be paid as staking rewards. + */ + int64 max_total_reward = 14; +} + +/** + * A transaction body for node stake update. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update the staking information. + */ + NodeStakeUpdateTransactionBody node_stake_update = 51; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/node_update_transaction.proto b/packages/proto/minimal_src/node_update_transaction.proto new file mode 100644 index 0000000000..91a38fd55f --- /dev/null +++ b/packages/proto/minimal_src/node_update_transaction.proto @@ -0,0 +1,153 @@ +/** + * # Node Update Transaction + * Transaction for updating consensus node attributes. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for node update. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A wrapper for optional string values. + */ +message StringValue { + /** + * The string value. + */ + string value = 1; +} + +/** + * A wrapper for optional boolean values. + */ +message BoolValue { + /** + * The boolean value. + */ + bool value = 1; +} + +/** + * Transaction body to modify address book node attributes. + */ +message NodeUpdateTransactionBody { + /** + * A consensus node identifier in the network state. + */ + uint64 node_id = 1; + + /** + * An account identifier. + */ + AccountID account_id = 2; + + /** + * A short description of the node. + */ + StringValue description = 3; + + /** + * A list of service endpoints for gossip. + */ + repeated ServiceEndpoint gossip_endpoint = 4; + + /** + * A list of service endpoints for gRPC calls. + */ + repeated ServiceEndpoint service_endpoint = 5; + + /** + * A certificate used to sign gossip events. + */ + BytesValue gossip_ca_certificate = 6; + + /** + * A hash of the node gRPC TLS certificate. + */ + BytesValue grpc_certificate_hash = 7; + + /** + * An administrative key controlled by the node operator. + */ + Key admin_key = 8; + + /** + * A boolean indicating that this node has chosen to decline node rewards. + */ + BoolValue decline_reward = 9; + + /** + * A web proxy for gRPC from non-gRPC clients. + */ + ServiceEndpoint grpc_proxy_endpoint = 10; +} + +/** + * A transaction body for node update. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update a node in the network address book. + */ + NodeUpdateTransactionBody nodeUpdate = 55; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/response_code.proto b/packages/proto/minimal_src/response_code.proto new file mode 100644 index 0000000000..6dadd9f177 --- /dev/null +++ b/packages/proto/minimal_src/response_code.proto @@ -0,0 +1,1768 @@ +/** + * # Response Code Enumeration + * An enumeration of possible response codes. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +/** + * An enumeration of possible response codes. + */ +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; + + /** + * Attempt to set negative receive record threshold + */ + INVALID_RECEIVE_RECORD_THRESHOLD = 86 [deprecated = true]; + + /** + * 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. Verify the bytes for an Ed25519 public key are exactly 32 bytes; and the bytes for a compressed ECDSA(secp256k1) key are exactly 33 bytes, with the first byte either 0x02 or 0x03.. + */ + 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; + + /** + * A fungible token transfer expected a different number of decimals than the involved + * type actually has. + */ + UNEXPECTED_TOKEN_DECIMALS = 283; + + /** + * The proxy account id is invalid or does not exist. + */ + INVALID_PROXY_ACCOUNT_ID = 284 [deprecated = true]; + + /** + * The transfer account id in CryptoDelete transaction is invalid or does not exist. + */ + INVALID_TRANSFER_ACCOUNT_ID = 285; + + /** + * The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. + */ + INVALID_FEE_COLLECTOR_ACCOUNT_ID = 286; + + /** + * The alias already set on an account cannot be updated using CryptoUpdate transaction. + */ + ALIAS_IS_IMMUTABLE = 287; + + /** + * An approved allowance specifies a spender account that is the same as the hbar/token + * owner account. + */ + SPENDER_ACCOUNT_SAME_AS_OWNER = 288; + + /** + * The establishment or adjustment of an approved allowance cause the token allowance + * to exceed the token maximum supply. + */ + AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY = 289; + + /** + * The specified amount for an approved allowance cannot be negative. + */ + NEGATIVE_ALLOWANCE_AMOUNT = 290; + + /** + * The approveForAll flag cannot be set for a fungible token. + */ + CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON = 291 [deprecated = true]; + + /** + * The spender does not have an existing approved allowance with the hbar/token owner. + */ + SPENDER_DOES_NOT_HAVE_ALLOWANCE = 292; + + /** + * The transfer amount exceeds the current approved allowance for the spender account. + */ + AMOUNT_EXCEEDS_ALLOWANCE = 293; + + /** + * The payer account of an approveAllowances or adjustAllowance transaction is attempting + * to go beyond the maximum allowed number of allowances. + */ + MAX_ALLOWANCES_EXCEEDED = 294; + + /** + * No allowances have been specified in the approval transaction. + */ + EMPTY_ALLOWANCES = 295; + + /** + * Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single + * CryptoApproveAllowance transaction. + */ + SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES = 296 [deprecated = true]; + + /** + * Serial numbers are repeated in nft allowance for a single spender account + */ + REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES = 297 [deprecated = true]; + + /** + * Fungible common token used in NFT allowances + */ + FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES = 298; + + /** + * Non fungible token used in fungible token allowances + */ + NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES = 299; + + /** + * The account id specified as the owner is invalid or does not exist. + */ + INVALID_ALLOWANCE_OWNER_ID = 300; + + /** + * The account id specified as the spender is invalid or does not exist. + */ + INVALID_ALLOWANCE_SPENDER_ID = 301; + + /** + * [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. + */ + REPEATED_ALLOWANCES_TO_DELETE = 302 [deprecated = true]; + + /** + * If the account Id specified as the delegating spender is invalid or does not exist. + */ + INVALID_DELEGATING_SPENDER = 303; + + /** + * The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. + */ + DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL = 304; + + /** + * The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll + * granted on token-owner. + */ + DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL = 305; + + /** + * The scheduled transaction could not be created because it's expiration_time was too far in the future. + */ + SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE = 306; + + /** + * The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. + */ + SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME = 307; + + /** + * The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. + */ + SCHEDULE_FUTURE_THROTTLE_EXCEEDED = 308; + + /** + * The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. + */ + SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED = 309; + + /** + * The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. + */ + INVALID_ETHEREUM_TRANSACTION = 310; + + /** + * EthereumTransaction was signed against a chainId that this network does not support. + */ + WRONG_CHAIN_ID = 311; + + /** + * This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. + */ + WRONG_NONCE = 312; + + /** + * The ethereum transaction specified an access list, which the network does not support. + */ + ACCESS_LIST_UNSUPPORTED = 313; + + /** + * A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. + */ + SCHEDULE_PENDING_EXPIRATION = 314; + + /** + * A selfdestruct or ContractDelete targeted a contract that is a token treasury. + */ + CONTRACT_IS_TOKEN_TREASURY = 315; + + /** + * A selfdestruct or ContractDelete targeted a contract with non-zero token balances. + */ + CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES = 316; + + /** + * A contract referenced by a transaction is "detached"; that is, expired and lacking any + * hbar funds for auto-renewal payment---but still within its post-expiry grace period. + */ + CONTRACT_EXPIRED_AND_PENDING_REMOVAL = 317; + + /** + * A ContractUpdate requested removal of a contract's auto-renew account, but that contract has + * no auto-renew account. + */ + CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT = 318; + + /** + * A delete transaction submitted via HAPI set permanent_removal=true + */ + PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION = 319; + + /* + * A CryptoCreate or ContractCreate used the deprecated proxyAccountID field. + */ + PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED = 320; + + /** + * An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. + */ + SELF_STAKING_IS_NOT_ALLOWED = 321; + + /** + * The staking account id or staking node id given is invalid or does not exist. + */ + INVALID_STAKING_ID = 322; + + /** + * Native staking, while implemented, has not yet enabled by the council. + */ + STAKING_NOT_ENABLED = 323; + + /** + * The range provided in UtilPrng transaction is negative. + */ + INVALID_PRNG_RANGE = 324; + + /** + * The maximum number of entities allowed in the current price regime have been created. + */ + MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED = 325; + + /** + * The full prefix signature for precompile is not valid + */ + INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE = 326; + + /** + * The combined balances of a contract and its auto-renew account (if any) did not cover + * the rent charged for net new storage used in a transaction. + */ + INSUFFICIENT_BALANCES_FOR_STORAGE_RENT = 327; + + /** + * A contract transaction tried to use more than the allowed number of child records, via + * either system contract records or internal contract creations. + */ + MAX_CHILD_RECORDS_EXCEEDED = 328; + + /** + * The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover + * the auto-renewal fees in a transaction. + */ + INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES = 329; + + /** + * A transaction's protobuf message includes unknown fields; could mean that a client + * expects not-yet-released functionality to be available. + */ + TRANSACTION_HAS_UNKNOWN_FIELDS = 330; + + /** + * The account cannot be modified. Account's key is not set + */ + ACCOUNT_IS_IMMUTABLE = 331; + + /** + * An alias that is assigned to an account or contract cannot be assigned to another account or contract. + */ + ALIAS_ALREADY_ASSIGNED = 332; + + /** + * A provided metadata key was invalid. Verification includes, for example, checking the size of Ed25519 and ECDSA(secp256k1) public keys. + */ + INVALID_METADATA_KEY = 333; + + /** + * Metadata key is not set on token + */ + TOKEN_HAS_NO_METADATA_KEY = 334; + + /** + * Token Metadata is not provided + */ + MISSING_TOKEN_METADATA = 335; + /** + * NFT serial numbers are missing in the TokenUpdateNftsTransactionBody + */ + MISSING_SERIAL_NUMBERS = 336; + + /** + * Admin key is not set on token + */ + TOKEN_HAS_NO_ADMIN_KEY = 337; + + /** + * A transaction failed because the consensus node identified is + * deleted from the address book. + */ + NODE_DELETED = 338; + + /** + * A transaction failed because the consensus node identified is not valid or + * does not exist in state. + */ + INVALID_NODE_ID = 339; + + /** + * A transaction failed because one or more entries in the list of + * service endpoints for the `gossip_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + */ + INVALID_GOSSIP_ENDPOINT = 340; + + /** + * A transaction failed because the node account identifier provided + * does not exist or is not valid.
+ * One common source of this error is providing a node account identifier + * using the "alias" form rather than "numeric" form. + * It is also used for atomic batch transaction for child transaction if the node account id is not 0.0.0. + */ + INVALID_NODE_ACCOUNT_ID = 341; + + /** + * A transaction failed because the description field cannot be encoded + * as UTF-8 or is more than 100 bytes when encoded. + */ + INVALID_NODE_DESCRIPTION = 342; + + /** + * A transaction failed because one or more entries in the list of + * service endpoints for the `service_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + */ + INVALID_SERVICE_ENDPOINT = 343; + + /** + * A transaction failed because the TLS certificate provided for the + * node is missing or invalid. + *

+ * #### Probable Causes + * The certificate MUST be a TLS certificate of a type permitted for gossip + * signatures.
+ * The value presented MUST be a UTF-8 NFKD encoding of the TLS + * certificate.
+ * The certificate encoded MUST be in PEM format.
+ * The `gossip_ca_certificate` field is REQUIRED and MUST NOT be empty. + */ + INVALID_GOSSIP_CA_CERTIFICATE = 344; + + /** + * A transaction failed because the hash provided for the gRPC certificate + * is present but invalid. + *

+ * #### Probable Causes + * The `grpc_certificate_hash` MUST be a SHA-384 hash.
+ * The input hashed MUST be a UTF-8 NFKD encoding of the actual TLS + * certificate.
+ * The certificate to be encoded MUST be in PEM format. + */ + INVALID_GRPC_CERTIFICATE = 345; + + /** + * The maximum automatic associations value is not valid.
+ * The most common cause for this error is a value less than `-1`. + */ + INVALID_MAX_AUTO_ASSOCIATIONS = 346; + + /** + * The maximum number of nodes allowed in the address book have been created. + */ + MAX_NODES_CREATED = 347; + + /** + * In ServiceEndpoint, domain_name and ipAddressV4 are mutually exclusive + */ + IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT = 348; + + /** + * Fully qualified domain name is not allowed in gossip_endpoint + */ + GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN = 349; + + /** + * In ServiceEndpoint, domain_name size too large + */ + FQDN_SIZE_TOO_LARGE = 350; + + /** + * ServiceEndpoint is invalid + */ + INVALID_ENDPOINT = 351; + + /** + * The number of gossip endpoints exceeds the limit + */ + GOSSIP_ENDPOINTS_EXCEEDED_LIMIT = 352; + + /** + * The transaction attempted to use duplicate `TokenReference`.
+ * This affects `TokenReject` attempting to reject same token reference more than once. + */ + TOKEN_REFERENCE_REPEATED = 353; + + /** + * The account id specified as the owner in `TokenReject` is invalid or does not exist. + */ + INVALID_OWNER_ID = 354; + + /** + * The transaction attempted to use more than the allowed number of `TokenReference`. + */ + TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED = 355; + + /** + * The number of service endpoints exceeds the limit + */ + SERVICE_ENDPOINTS_EXCEEDED_LIMIT = 356; + + /* + * The IPv4 address is invalid + */ + INVALID_IPV4_ADDRESS = 357; + + /** + * The transaction attempted to use empty `TokenReference` list. + */ + EMPTY_TOKEN_REFERENCE_LIST = 358; + + /* + * The node account is not allowed to be updated + */ + UPDATE_NODE_ACCOUNT_NOT_ALLOWED = 359; + + /* + * The token has no metadata or supply key + */ + TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY = 360; + + /** + * The list of `PendingAirdropId`s is empty and MUST NOT be empty. + */ + EMPTY_PENDING_AIRDROP_ID_LIST = 361; + + /** + * A `PendingAirdropId` is repeated in a `claim` or `cancel` transaction. + */ + PENDING_AIRDROP_ID_REPEATED = 362; + + /** + * The number of `PendingAirdropId` values in the list exceeds the maximum + * allowable number. + */ + PENDING_AIRDROP_ID_LIST_TOO_LONG = 363; + + /* + * A pending airdrop already exists for the specified NFT. + */ + PENDING_NFT_AIRDROP_ALREADY_EXISTS = 364; + + /* + * The identified account is sender for one or more pending airdrop(s) + * and cannot be deleted. + *

+ * The requester SHOULD cancel all pending airdrops before resending + * this transaction. + */ + ACCOUNT_HAS_PENDING_AIRDROPS = 365; + + /** + * Consensus throttle did not allow execution of this transaction.
+ * The transaction should be retried after a modest delay. + */ + THROTTLED_AT_CONSENSUS = 366; + + /** + * The provided pending airdrop id is invalid.
+ * This pending airdrop MAY already be claimed or cancelled. + *

+ * The client SHOULD query a mirror node to determine the current status of + * the pending airdrop. + */ + INVALID_PENDING_AIRDROP_ID = 367; + + /** + * The token to be airdropped has a fallback royalty fee and cannot be + * sent or claimed via an airdrop transaction. + */ + TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY = 368; + + /** + * This airdrop claim is for a pending airdrop with an invalid token.
+ * The token might be deleted, or the sender may not have enough tokens + * to fulfill the offer. + *

+ * The client SHOULD query mirror node to determine the status of the + * pending airdrop and whether the sender can fulfill the offer. + */ + INVALID_TOKEN_IN_PENDING_AIRDROP = 369; + + /** + * A scheduled transaction configured to wait for expiry to execute was given + * an expiry time at which there is already too many transactions scheduled to + * expire; its creation must be retried with a different expiry. + */ + SCHEDULE_EXPIRY_IS_BUSY = 370; + + /** + * The provided gRPC certificate hash is invalid. + */ + INVALID_GRPC_CERTIFICATE_HASH = 371; + + /** + * A scheduled transaction configured to wait for expiry to execute was not + * given an explicit expiration time. + */ + MISSING_EXPIRY_TIME = 372; + + /** + * A contract operation attempted to schedule another transaction after it + * had already scheduled a recursive contract call. + */ + NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION = 373; + + /** + * A contract can schedule recursive calls a finite number of times (this is + * approximately four million times with typical network configuration.) + */ + RECURSIVE_SCHEDULING_LIMIT_REACHED = 374; + + /** + * The target network is waiting for the ledger ID to be set, which is a + * side effect of finishing the network's TSS construction. + */ + WAITING_FOR_LEDGER_ID = 375; + + /** + * The provided fee exempt key list size exceeded the limit. + */ + MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED = 376; + + /** + * The provided fee exempt key list contains duplicated keys. + */ + FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS = 377; + + /** + * The provided fee exempt key list contains an invalid key. + */ + INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST = 378; + + /** + * The provided fee schedule key contains an invalid key. + */ + INVALID_FEE_SCHEDULE_KEY = 379; + + /** + * If a fee schedule key is not set when we create a topic + * we cannot add it on update. + */ + FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED = 380; + + /** + * If the topic's custom fees are updated the topic SHOULD have a + * fee schedule key + */ + FEE_SCHEDULE_KEY_NOT_SET = 381; + + /** + * The fee amount is exceeding the amount that the payer + * is willing to pay. + */ + MAX_CUSTOM_FEE_LIMIT_EXCEEDED = 382; + + /** + * There are no corresponding custom fees. + */ + NO_VALID_MAX_CUSTOM_FEE = 383; + + /** + * The provided list contains invalid max custom fee. + */ + INVALID_MAX_CUSTOM_FEES = 384; + + /** + * The provided max custom fee list contains fees with + * duplicate denominations. + */ + DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST = 385; + + /** + * The provided max custom fee list contains fees with + * duplicate account id. + */ + DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST = 386; + + /** + * Max custom fees list is not supported for this operation. + */ + MAX_CUSTOM_FEES_IS_NOT_SUPPORTED = 387; + + /** + * The list of batch transactions is empty + */ + BATCH_LIST_EMPTY = 388; + + /** + * The list of batch transactions contains duplicated transactions + */ + BATCH_LIST_CONTAINS_DUPLICATES = 389; + + /** + * The list of batch transactions contains a transaction type that is + * in the AtomicBatch blacklist as configured in the network. + */ + BATCH_TRANSACTION_IN_BLACKLIST = 390; + + /** + * The inner transaction of a batch transaction failed + */ + INNER_TRANSACTION_FAILED = 391; + + /** + * The inner transaction of a batch transaction is missing a batch key + */ + MISSING_BATCH_KEY = 392; + + /** + * The batch key is set for a non batch transaction + */ + BATCH_KEY_SET_ON_NON_INNER_TRANSACTION = 393; + + /** + * The batch key is not valid + */ + INVALID_BATCH_KEY = 394; + + /** + * The provided schedule expiry time is not configurable. + */ + SCHEDULE_EXPIRY_NOT_CONFIGURABLE = 395; + + /** + * The network just started at genesis and is creating system entities. + */ + CREATING_SYSTEM_ENTITIES = 396; + + /** + * The least common multiple of the throttle group's milliOpsPerSec is + * too large and it's overflowing. + */ + THROTTLE_GROUP_LCM_OVERFLOW = 397; + + /** + * Token airdrop transactions can not contain multiple senders for a single token. + */ + AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN = 398; + + /** + * The GRPC proxy endpoint is set in the NodeCreate or NodeUpdate transaction, + * which the network does not support. + */ + GRPC_WEB_PROXY_NOT_SUPPORTED = 399; + + /** + * An NFT transfers list referenced a token type other than NON_FUNGIBLE_UNIQUE. + */ + NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = 400; +} diff --git a/packages/proto/minimal_src/schedule_delete.proto b/packages/proto/minimal_src/schedule_delete.proto new file mode 100644 index 0000000000..2ed9028763 --- /dev/null +++ b/packages/proto/minimal_src/schedule_delete.proto @@ -0,0 +1,24 @@ +/** + * # Schedule Delete + * Delete a scheduled transaction. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Marks a schedule in the network's action queue as deleted, preventing it from executing. + */ +message ScheduleDeleteTransactionBody { + /** + * The ID of the Scheduled Entity to be deleted. + */ + ScheduleID scheduleID = 1; +} + diff --git a/packages/proto/minimal_src/schedule_delete_transaction.proto b/packages/proto/minimal_src/schedule_delete_transaction.proto new file mode 100644 index 0000000000..efdf0fbc18 --- /dev/null +++ b/packages/proto/minimal_src/schedule_delete_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Schedule Delete Transaction + * Transaction for deleting scheduled transactions. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "schedule_delete.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for schedule deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for schedule deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a schedule. + */ + ScheduleDeleteTransactionBody scheduleDelete = 34; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/schedule_sign_transaction.proto b/packages/proto/minimal_src/schedule_sign_transaction.proto new file mode 100644 index 0000000000..ca6bdd0644 --- /dev/null +++ b/packages/proto/minimal_src/schedule_sign_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Schedule Sign Transaction + * Transaction for adding signatures to an existing scheduled transaction. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for schedule sign. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Add signatures to an existing scheduled transaction. + */ +message ScheduleSignTransactionBody { + /** + * A schedule identifier. + */ + ScheduleID scheduleID = 1; +} + +/** + * A transaction body for schedule sign. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Sign a schedule. + */ + ScheduleSignTransactionBody scheduleSign = 44; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/system_delete_transaction.proto b/packages/proto/minimal_src/system_delete_transaction.proto new file mode 100644 index 0000000000..89f6efe83a --- /dev/null +++ b/packages/proto/minimal_src/system_delete_transaction.proto @@ -0,0 +1,101 @@ +/** + * # System Delete Transaction + * Transaction for deleting files or contracts as an administrative function. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "timestamp.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for system delete. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Delete a file or contract bytecode as an administrative transaction. + */ +message SystemDeleteTransactionBody { + oneof id { + /** + * A file identifier. + */ + FileID fileID = 1; + + /** + * A contract identifier. + */ + ContractID contractID = 2; + } + + /** + * A timestamp indicating when the file will be removed from state. + */ + TimestampSeconds expirationTime = 3; +} + +/** + * A transaction body for system delete. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete a file or contract as an administrative function. + */ + SystemDeleteTransactionBody systemDelete = 20; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/system_undelete_transaction.proto b/packages/proto/minimal_src/system_undelete_transaction.proto new file mode 100644 index 0000000000..5f11a1d3c8 --- /dev/null +++ b/packages/proto/minimal_src/system_undelete_transaction.proto @@ -0,0 +1,95 @@ +/** + * # System Undelete Transaction + * Transaction for recovering files or contracts deleted by system delete. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for system undelete. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Recover a file or contract bytecode deleted by a system delete transaction. + */ +message SystemUndeleteTransactionBody { + oneof id { + /** + * A file identifier. + */ + FileID fileID = 1; + + /** + * A contract identifier. + */ + ContractID contractID = 2; + } +} + +/** + * A transaction body for system undelete. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Recover a file or contract deleted by system delete. + */ + SystemUndeleteTransactionBody systemUndelete = 21; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/timestamp.proto b/packages/proto/minimal_src/timestamp.proto new file mode 100644 index 0000000000..1d2b96a0f9 --- /dev/null +++ b/packages/proto/minimal_src/timestamp.proto @@ -0,0 +1,64 @@ +/** + * # Timestamp + * Messages to describe exact date-time values, with resolution of seconds or + * nanoseconds, referenced to the UNIX epoch. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +/** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ +message Timestamp { + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + int64 seconds = 1; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + int32 nanos = 2; +} + +/** + * An exact date and time, with a resolution of one second. + */ +message TimestampSeconds { + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + int64 seconds = 1; +} diff --git a/packages/proto/minimal_src/token_airdrop_transaction.proto b/packages/proto/minimal_src/token_airdrop_transaction.proto new file mode 100644 index 0000000000..8cbba1ab1a --- /dev/null +++ b/packages/proto/minimal_src/token_airdrop_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Token Airdrop Transaction + * Transaction for airdropping tokens to accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token airdrop. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Airdrop one or more tokens to one or more accounts. + */ +message TokenAirdropTransactionBody { + /** + * A list of token transfers representing one or more airdrops. + */ + repeated TokenTransferList token_transfers = 1; +} + +/** + * A transaction body for token airdrop. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Airdrop tokens. + */ + TokenAirdropTransactionBody tokenAirdrop = 58; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_associate.proto b/packages/proto/minimal_src/token_associate.proto new file mode 100644 index 0000000000..9e1df2aeb1 --- /dev/null +++ b/packages/proto/minimal_src/token_associate.proto @@ -0,0 +1,29 @@ +/** + * # Token Associate + * Associate tokens with an account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenAssociateTransactionBody { + /** + * The account to be associated with the provided tokens. + */ + AccountID account = 1; + + /** + * The tokens to be associated with the provided account. + */ + repeated TokenID tokens = 2; +} + diff --git a/packages/proto/minimal_src/token_associate_transaction.proto b/packages/proto/minimal_src/token_associate_transaction.proto new file mode 100644 index 0000000000..7291b6da1b --- /dev/null +++ b/packages/proto/minimal_src/token_associate_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Associate Transaction + * Transaction for associating tokens with accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_associate.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token association. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token association. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Associate tokens to an account. + */ + TokenAssociateTransactionBody tokenAssociate = 32; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_burn.proto b/packages/proto/minimal_src/token_burn.proto new file mode 100644 index 0000000000..077c5709ef --- /dev/null +++ b/packages/proto/minimal_src/token_burn.proto @@ -0,0 +1,36 @@ +/** + * # Token Burn + * Burn tokens from the treasury account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenBurnTransactionBody { + /** + * The token for which to burn tokens. + */ + TokenID token = 1; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to burn from the Treasury Account. + */ + 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/packages/proto/minimal_src/token_burn_transaction.proto b/packages/proto/minimal_src/token_burn_transaction.proto new file mode 100644 index 0000000000..b53452f89a --- /dev/null +++ b/packages/proto/minimal_src/token_burn_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Burn Transaction + * Transaction for burning tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_burn.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token burning. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token burning. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Burn tokens from the treasury account. + */ + TokenBurnTransactionBody tokenBurn = 30; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_cancel_airdrop_transaction.proto b/packages/proto/minimal_src/token_cancel_airdrop_transaction.proto new file mode 100644 index 0000000000..26e0ff3ad4 --- /dev/null +++ b/packages/proto/minimal_src/token_cancel_airdrop_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Token Cancel Airdrop Transaction + * Transaction for canceling pending airdrops. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token cancel airdrop. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Token cancel airdrop - remove pending airdrops from state. + */ +message TokenCancelAirdropTransactionBody { + /** + * A list of one or more pending airdrop identifiers. + */ + repeated PendingAirdropId pending_airdrops = 1; +} + +/** + * A transaction body for token cancel airdrop. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Cancel one or more pending airdrops. + */ + TokenCancelAirdropTransactionBody tokenCancelAirdrop = 59; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_claim_airdrop_transaction.proto b/packages/proto/minimal_src/token_claim_airdrop_transaction.proto new file mode 100644 index 0000000000..a1e443c4d2 --- /dev/null +++ b/packages/proto/minimal_src/token_claim_airdrop_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Token Claim Airdrop Transaction + * Transaction for claiming pending airdrops. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token claim airdrop. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Token claim airdrop - complete pending transfers for an airdrop. + */ +message TokenClaimAirdropTransactionBody { + /** + * A list of one or more pending airdrop identifiers. + */ + repeated PendingAirdropId pending_airdrops = 1; +} + +/** + * A transaction body for token claim airdrop. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Claim one or more pending airdrops. + */ + TokenClaimAirdropTransactionBody tokenClaimAirdrop = 60; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_create.proto b/packages/proto/minimal_src/token_create.proto new file mode 100644 index 0000000000..14c6b05468 --- /dev/null +++ b/packages/proto/minimal_src/token_create.proto @@ -0,0 +1,137 @@ +/** + * # Token Create + * Create a new token on Hedera. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; +import "custom_fees.proto"; + +/** + * Create a new token. + */ +message TokenCreateTransactionBody { + /** + * The publicly visible name of the token. + */ + string name = 1; + + /** + * The publicly visible token symbol. + */ + string symbol = 2; + + /** + * The number of decimal places a token is divisible by. + */ + uint32 decimals = 3; + + /** + * Specifies the initial supply of tokens to be put in circulation. + */ + uint64 initialSupply = 4; + + /** + * The account which will act as a treasury for the token. + */ + AccountID treasury = 5; + + /** + * The key which can perform update/delete operations on the token. + */ + Key adminKey = 6; + + /** + * The key which can grant or revoke KYC of an account for the token's transactions. + */ + Key kycKey = 7; + + /** + * The key which can sign to freeze or unfreeze an account for token transactions. + */ + Key freezeKey = 8; + + /** + * The key which can wipe the token balance of an account. + */ + Key wipeKey = 9; + + /** + * The key which can change the supply of a token. + */ + Key supplyKey = 10; + + /** + * The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. + */ + bool freezeDefault = 11; + + /** + * The epoch second at which the token should expire. + */ + Timestamp expiry = 13; + + /** + * An account which will be automatically charged to renew the token's expiration. + */ + 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. + */ + string memo = 16; + + /** + * IWA compatibility. Specifies the token type. + */ + TokenType tokenType = 17; + + /** + * IWA compatibility. Specified the supply type of the token. + */ + TokenSupplyType supplyType = 18; + + /** + * IWA Compatibility. Depends on TokenSupplyType. + */ + int64 maxSupply = 19; + + /** + * The key which can change the token's custom fee schedule. + */ + 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. + */ + Key pause_key = 22; + + /** + * Metadata that is passed through and not validated. + */ + bytes metadata = 23; + + /** + * The key which can update the metadata of a token. + */ + Key metadata_key = 24; +} + diff --git a/packages/proto/minimal_src/token_create_transaction.proto b/packages/proto/minimal_src/token_create_transaction.proto new file mode 100644 index 0000000000..2233671b71 --- /dev/null +++ b/packages/proto/minimal_src/token_create_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Create Transaction + * Transaction for creating new tokens on Hedera. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_create.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token creation. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token creation. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Create a new Hedera token. + */ + TokenCreateTransactionBody tokenCreation = 29; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_delete.proto b/packages/proto/minimal_src/token_delete.proto new file mode 100644 index 0000000000..853b1b424d --- /dev/null +++ b/packages/proto/minimal_src/token_delete.proto @@ -0,0 +1,24 @@ +/** + * # Token Delete + * Delete a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Marks a token as deleted. + */ +message TokenDeleteTransactionBody { + /** + * The token to be deleted. + */ + TokenID token = 1; +} + diff --git a/packages/proto/minimal_src/token_delete_transaction.proto b/packages/proto/minimal_src/token_delete_transaction.proto new file mode 100644 index 0000000000..8cb67b8f89 --- /dev/null +++ b/packages/proto/minimal_src/token_delete_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Delete Transaction + * Transaction for deleting tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_delete.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token deletion. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token deletion. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Delete an Hedera token. + */ + TokenDeleteTransactionBody tokenDeletion = 27; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_dissociate.proto b/packages/proto/minimal_src/token_dissociate.proto new file mode 100644 index 0000000000..f3f1fed939 --- /dev/null +++ b/packages/proto/minimal_src/token_dissociate.proto @@ -0,0 +1,29 @@ +/** + * # Token Dissociate + * Dissociate tokens from an account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenDissociateTransactionBody { + /** + * The account to be dissociated from the provided tokens. + */ + AccountID account = 1; + + /** + * The tokens to be dissociated from the provided account. + */ + repeated TokenID tokens = 2; +} + diff --git a/packages/proto/minimal_src/token_dissociate_transaction.proto b/packages/proto/minimal_src/token_dissociate_transaction.proto new file mode 100644 index 0000000000..ec6a6c3956 --- /dev/null +++ b/packages/proto/minimal_src/token_dissociate_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Dissociate Transaction + * Transaction for dissociating tokens from accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_dissociate.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token dissociation. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token dissociation. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Dissociate tokens from an account. + */ + TokenDissociateTransactionBody tokenDissociate = 33; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_fee_schedule_update_transaction.proto b/packages/proto/minimal_src/token_fee_schedule_update_transaction.proto new file mode 100644 index 0000000000..5eb2410601 --- /dev/null +++ b/packages/proto/minimal_src/token_fee_schedule_update_transaction.proto @@ -0,0 +1,93 @@ +/** + * # Token Fee Schedule Update Transaction + * Transaction for updating the custom fee schedule for a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "custom_fees.proto"; +import "duration.proto"; + +/** + * A wrapper around signed transaction bytes for token fee schedule update. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Update the custom fee schedule for a token type. + */ +message TokenFeeScheduleUpdateTransactionBody { + /** + * A token identifier. + */ + TokenID token_id = 1; + + /** + * A list of custom fees representing a fee schedule. + */ + repeated CustomFee custom_fees = 2; +} + +/** + * A transaction body for token fee schedule update. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update the custom fee schedule for a token. + */ + TokenFeeScheduleUpdateTransactionBody token_fee_schedule_update = 45; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_freeze_account.proto b/packages/proto/minimal_src/token_freeze_account.proto new file mode 100644 index 0000000000..31688aacbc --- /dev/null +++ b/packages/proto/minimal_src/token_freeze_account.proto @@ -0,0 +1,29 @@ +/** + * # Token Freeze Account + * Freeze an account with respect to a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenFreezeAccountTransactionBody { + /** + * The token for which this account will be frozen. + */ + TokenID token = 1; + + /** + * The account to be frozen. + */ + AccountID account = 2; +} + diff --git a/packages/proto/minimal_src/token_freeze_account_transaction.proto b/packages/proto/minimal_src/token_freeze_account_transaction.proto new file mode 100644 index 0000000000..a07c239502 --- /dev/null +++ b/packages/proto/minimal_src/token_freeze_account_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Freeze Account Transaction + * Transaction for freezing accounts with respect to tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_freeze_account.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token account freezing. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token account freezing. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Freeze an account with respect to a token. + */ + TokenFreezeAccountTransactionBody tokenFreeze = 23; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_grant_kyc.proto b/packages/proto/minimal_src/token_grant_kyc.proto new file mode 100644 index 0000000000..1de90a4572 --- /dev/null +++ b/packages/proto/minimal_src/token_grant_kyc.proto @@ -0,0 +1,29 @@ +/** + * # Token Grant KYC + * Grant KYC to an account for a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenGrantKycTransactionBody { + /** + * The token for which this account will be granted KYC. + */ + TokenID token = 1; + + /** + * The account to be KYCed. + */ + AccountID account = 2; +} + diff --git a/packages/proto/minimal_src/token_grant_kyc_transaction.proto b/packages/proto/minimal_src/token_grant_kyc_transaction.proto new file mode 100644 index 0000000000..e165628bd6 --- /dev/null +++ b/packages/proto/minimal_src/token_grant_kyc_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Grant KYC Transaction + * Transaction for granting KYC to accounts for tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_grant_kyc.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token KYC granting. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token KYC granting. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Grant KYC to an account with respect to a token. + */ + TokenGrantKycTransactionBody tokenGrantKyc = 25; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_mint.proto b/packages/proto/minimal_src/token_mint.proto new file mode 100644 index 0000000000..39b792fe2c --- /dev/null +++ b/packages/proto/minimal_src/token_mint.proto @@ -0,0 +1,36 @@ +/** + * # Token Mint + * Mint tokens to the treasury account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenMintTransactionBody { + /** + * The token for which to mint tokens. + */ + TokenID token = 1; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to mint to the Treasury Account. + */ + uint64 amount = 2; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * A list of metadata that are being created. + */ + repeated bytes metadata = 3; +} + diff --git a/packages/proto/minimal_src/token_mint_transaction.proto b/packages/proto/minimal_src/token_mint_transaction.proto new file mode 100644 index 0000000000..645aaf705f --- /dev/null +++ b/packages/proto/minimal_src/token_mint_transaction.proto @@ -0,0 +1,105 @@ +/** + * # Token Mint Transaction + * Transaction for minting tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; +import "token_mint.proto"; + +message Transaction { + // <<>> This comment is special code for setting PBJ Compiler java package + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + TransactionBody body = 1 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + SignatureList sigs = 2 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + SignatureMap sigMap = 3 [deprecated = true]; + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + bytes bodyBytes = 4 [deprecated = true]; + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token minting. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Mint new tokens. + */ + TokenMintTransactionBody tokenMint = 29; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_pause.proto b/packages/proto/minimal_src/token_pause.proto new file mode 100644 index 0000000000..05974d9f3e --- /dev/null +++ b/packages/proto/minimal_src/token_pause.proto @@ -0,0 +1,24 @@ +/** + * # Token Pause + * Pause a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenPauseTransactionBody { + /** + * The token to be paused. + */ + TokenID token = 1; +} + diff --git a/packages/proto/minimal_src/token_pause_transaction.proto b/packages/proto/minimal_src/token_pause_transaction.proto new file mode 100644 index 0000000000..3091e85e32 --- /dev/null +++ b/packages/proto/minimal_src/token_pause_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Pause Transaction + * Transaction for pausing tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_pause.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token pausing. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token pausing. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Pause a Token. + */ + TokenPauseTransactionBody token_pause = 35; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_reject_transaction.proto b/packages/proto/minimal_src/token_reject_transaction.proto new file mode 100644 index 0000000000..58e777f0a1 --- /dev/null +++ b/packages/proto/minimal_src/token_reject_transaction.proto @@ -0,0 +1,110 @@ +/** + * # Token Reject Transaction + * Transaction for rejecting undesired tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token reject. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A union token identifier. + */ +message TokenReference { + oneof token_identifier { + /** + * A fungible/common token type. + */ + TokenID fungible_token = 1; + + /** + * A single specific serialized non-fungible/unique token. + */ + NftID nft = 2; + } +} + +/** + * Reject undesired token(s). + */ +message TokenRejectTransactionBody { + /** + * An account identifier. + */ + AccountID owner = 1; + + /** + * A list of one or more token rejections. + */ + repeated TokenReference rejections = 2; +} + +/** + * A transaction body for token reject. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Reject and return a token to treasury. + */ + TokenRejectTransactionBody tokenReject = 57; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_revoke_kyc.proto b/packages/proto/minimal_src/token_revoke_kyc.proto new file mode 100644 index 0000000000..930c81de57 --- /dev/null +++ b/packages/proto/minimal_src/token_revoke_kyc.proto @@ -0,0 +1,29 @@ +/** + * # Token Revoke KYC + * Revoke KYC from an account for a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenRevokeKycTransactionBody { + /** + * The token for which this account will be revoked of its KYC. + */ + TokenID token = 1; + + /** + * The account to be revoked of its KYC. + */ + AccountID account = 2; +} + diff --git a/packages/proto/minimal_src/token_revoke_kyc_transaction.proto b/packages/proto/minimal_src/token_revoke_kyc_transaction.proto new file mode 100644 index 0000000000..7417b8eee9 --- /dev/null +++ b/packages/proto/minimal_src/token_revoke_kyc_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Revoke KYC Transaction + * Transaction for revoking KYC from accounts for tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_revoke_kyc.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token KYC revoking. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token KYC revoking. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Revoke KYC from an account with respect to a token. + */ + TokenRevokeKycTransactionBody tokenRevokeKyc = 26; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_unfreeze_account.proto b/packages/proto/minimal_src/token_unfreeze_account.proto new file mode 100644 index 0000000000..3d995c8d48 --- /dev/null +++ b/packages/proto/minimal_src/token_unfreeze_account.proto @@ -0,0 +1,29 @@ +/** + * # Token Unfreeze Account + * Unfreeze an account with respect to a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenUnfreezeAccountTransactionBody { + /** + * The token for which this account will be unfrozen. + */ + TokenID token = 1; + + /** + * The account to be unfrozen. + */ + AccountID account = 2; +} + diff --git a/packages/proto/minimal_src/token_unfreeze_account_transaction.proto b/packages/proto/minimal_src/token_unfreeze_account_transaction.proto new file mode 100644 index 0000000000..f7179244a1 --- /dev/null +++ b/packages/proto/minimal_src/token_unfreeze_account_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Unfreeze Account Transaction + * Transaction for unfreezing accounts with respect to tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_unfreeze_account.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token account unfreezing. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token account unfreezing. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Unfreeze an account with respect to a token. + */ + TokenUnfreezeAccountTransactionBody tokenUnfreeze = 24; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_unpause.proto b/packages/proto/minimal_src/token_unpause.proto new file mode 100644 index 0000000000..927309139f --- /dev/null +++ b/packages/proto/minimal_src/token_unpause.proto @@ -0,0 +1,24 @@ +/** + * # Token Unpause + * Unpause a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * Unpauses the Token from being paused. + */ +message TokenUnpauseTransactionBody { + /** + * The token to be unpaused. + */ + TokenID token = 1; +} + diff --git a/packages/proto/minimal_src/token_unpause_transaction.proto b/packages/proto/minimal_src/token_unpause_transaction.proto new file mode 100644 index 0000000000..9c59cf8b78 --- /dev/null +++ b/packages/proto/minimal_src/token_unpause_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Unpause Transaction + * Transaction for unpausing tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_unpause.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token unpausing. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token unpausing. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Unpause a Token. + */ + TokenUnpauseTransactionBody token_unpause = 36; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_update.proto b/packages/proto/minimal_src/token_update.proto new file mode 100644 index 0000000000..c65e2f4be2 --- /dev/null +++ b/packages/proto/minimal_src/token_update.proto @@ -0,0 +1,106 @@ +/** + * # Token Update + * Update a token. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "timestamp.proto"; + +/** + * At consensus, updates an already created token to the given values. + */ +message TokenUpdateTransactionBody { + /** + * The Token to be updated. + */ + TokenID token = 1; + + /** + * The new publicly visible token symbol. + */ + string symbol = 2; + + /** + * The new publicly visible name of the token. + */ + string name = 3; + + /** + * The new Treasury account of the Token. + */ + AccountID treasury = 4; + + /** + * The new admin key of the Token. + */ + Key adminKey = 5; + + /** + * The new KYC key of the Token. + */ + Key kycKey = 6; + + /** + * The new Freeze key of the Token. + */ + Key freezeKey = 7; + + /** + * The new Wipe key of the Token. + */ + Key wipeKey = 8; + + /** + * The new Supply key of the Token. + */ + Key supplyKey = 9; + + /** + * The new account which will be automatically charged to renew the token's expiration. + */ + 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. + */ + Timestamp expiry = 12; + + /** + * If set, the new memo to be associated with the token. + */ + string memo = 13; + + /** + * If set, the new key to use to update the token's custom fee schedule. + */ + Key fee_schedule_key = 14; + + /** + * If set, the new key that can pause and unpause the Token. + */ + Key pause_key = 15; + + /** + * The new metadata of the token. + */ + bytes metadata = 16; + + /** + * The new key which can update the metadata of a token. + */ + Key metadata_key = 17; +} + diff --git a/packages/proto/minimal_src/token_update_nfts_transaction.proto b/packages/proto/minimal_src/token_update_nfts_transaction.proto new file mode 100644 index 0000000000..1ab9d34f96 --- /dev/null +++ b/packages/proto/minimal_src/token_update_nfts_transaction.proto @@ -0,0 +1,108 @@ +/** + * # Token Update NFTs Transaction + * Transaction for updating metadata of non-fungible tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token update NFTs. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A wrapper for optional bytes values. + */ +message BytesValue { + /** + * The bytes value. + */ + bytes value = 1; +} + +/** + * Modify the metadata field for individual non-fungible tokens. + */ +message TokenUpdateNftsTransactionBody { + /** + * A token identifier. + */ + TokenID token = 1; + + /** + * A list of serial numbers to be updated. + */ + repeated int64 serial_numbers = 2; + + /** + * A new value for the metadata. + */ + BytesValue metadata = 3; +} + +/** + * A transaction body for token update NFTs. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update one or more non-fungible tokens. + */ + TokenUpdateNftsTransactionBody token_update_nfts = 53; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_update_transaction.proto b/packages/proto/minimal_src/token_update_transaction.proto new file mode 100644 index 0000000000..c2a886963b --- /dev/null +++ b/packages/proto/minimal_src/token_update_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Update Transaction + * Transaction for updating tokens. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_update.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token updates. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token updates. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Update an Hedera token. + */ + TokenUpdateTransactionBody tokenUpdate = 28; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/token_wipe_account.proto b/packages/proto/minimal_src/token_wipe_account.proto new file mode 100644 index 0000000000..23834fa0da --- /dev/null +++ b/packages/proto/minimal_src/token_wipe_account.proto @@ -0,0 +1,39 @@ +/** + * # Token Wipe Account + * Wipe tokens from an account. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +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. + */ +message TokenWipeAccountTransactionBody { + /** + * The token for which the account will be wiped. + */ + TokenID token = 1; + + /** + * The account to be wiped. + */ + AccountID account = 2; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe. + */ + 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/packages/proto/minimal_src/token_wipe_account_transaction.proto b/packages/proto/minimal_src/token_wipe_account_transaction.proto new file mode 100644 index 0000000000..b33456fa27 --- /dev/null +++ b/packages/proto/minimal_src/token_wipe_account_transaction.proto @@ -0,0 +1,78 @@ +/** + * # Token Wipe Account Transaction + * Transaction for wiping tokens from accounts. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "token_wipe_account.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for token wiping. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * A transaction body for token wiping. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Wipe tokens from an account. + */ + TokenWipeAccountTransactionBody tokenWipe = 31; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/minimal_src/transaction_contents.proto b/packages/proto/minimal_src/transaction_contents.proto new file mode 100644 index 0000000000..87f5b08718 --- /dev/null +++ b/packages/proto/minimal_src/transaction_contents.proto @@ -0,0 +1,50 @@ +/** + * # Transaction Contents + * The Signed Transaction message which forms the content of a transaction + * `signedTransactionBytes`. This message is the result of several changes + * to transaction message structure over time. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +import "basic_types.proto"; + +/** + * A combination transaction bytes and a map of signatures.
+ * This message contains a serialized `TransactionBody` in a byte array + * and a `SignatureMap` that contains all of the signatures offered to + * authenticate the transaction. + * + * ### Block Stream Effects + * This content is recorded in the record stream exactly as received. + */ +message SignedTransaction { + /** + * A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + */ + bytes bodyBytes = 1; + + /** + * A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + */ + SignatureMap sigMap = 2; +} diff --git a/packages/proto/minimal_src/transaction_response.proto b/packages/proto/minimal_src/transaction_response.proto new file mode 100644 index 0000000000..6134cfd027 --- /dev/null +++ b/packages/proto/minimal_src/transaction_response.proto @@ -0,0 +1,61 @@ +/** + * # Transaction Response + * Message(s) sent in response to submitting a transaction. + * The response(s) detailed here SHALL only represent that the transaction + * was received and checked by the single node to which it was submitted.
+ * To obtain the result from _network consensus_, a client MUST submit a + * `getTransactionReceipts` query. + * + * ### Keywords + * The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", + * "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + * document are to be interpreted as described in + * [RFC2119](https://www.ietf.org/rfc/rfc2119) and clarified in + * [RFC8174](https://www.ietf.org/rfc/rfc8174). + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +// <<>> This comment is special code for setting PBJ Compiler java package +option java_multiple_files = true; + +import "response_code.proto"; + +/** + * A message sent by a node in response to a transaction submission.
+ * This message only acknowledges that the individual node has checked + * the transaction, completed pre-check, and checked the fee offered. + * + * If the transaction fee is not sufficient, the `nodeTransactionPrecheckCode` + * value SHALL be `INSUFFICIENT_TX_FEE` and the `cost` field SHALL be the + * actual transaction fee, in tinybar, required.
+ * If the client requires acknowledgement of the network consensus result + * for a transaction, the client SHOULD request a transaction receipt or + * detailed transaction record. A client MAY also obtain network consensus + * results from a mirror node. + */ +message TransactionResponse { + /** + * A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + */ + ResponseCodeEnum nodeTransactionPrecheckCode = 1; + + /** + * An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + */ + uint64 cost = 2; +} diff --git a/packages/proto/minimal_src/util_prng_transaction.proto b/packages/proto/minimal_src/util_prng_transaction.proto new file mode 100644 index 0000000000..3c18a4f13d --- /dev/null +++ b/packages/proto/minimal_src/util_prng_transaction.proto @@ -0,0 +1,88 @@ +/** + * # Utility PRNG Transaction + * Transaction for requesting deterministic pseudo-random numbers. + */ +syntax = "proto3"; + +package proto; + +// SPDX-License-Identifier: Apache-2.0 +option java_package = "com.hederahashgraph.api.proto.java"; +option java_multiple_files = true; + +import "basic_types.proto"; +import "duration.proto"; +import "custom_fees.proto"; + +/** + * A wrapper around signed transaction bytes for utility PRNG. + */ +message Transaction { + /** + * A valid, serialized, `SignedTransaction` message. + */ + bytes signedTransactionBytes = 5; +} + +/** + * Request a deterministic pseudo-random number. + */ +message UtilPrngTransactionBody { + /** + * A range for the requested value. + */ + int32 range = 1; +} + +/** + * A transaction body for utility PRNG. + */ +message TransactionBody { + reserved 30, 61, 62, 63, 64; + + /** + * A transaction identifier. + */ + TransactionID transactionID = 1; + + /** + * A node account identifier. + */ + AccountID nodeAccountID = 2; + + /** + * A maximum transaction fee, in tinybar. + */ + uint64 transactionFee = 3; + + /** + * A maximum duration in which to execute this transaction. + */ + Duration transactionValidDuration = 4; + + /** + * A short description for this transaction. + */ + string memo = 6; + + /** + * The public key of the trusted batch assembler. + */ + Key batch_key = 73; + + oneof data { + /** + * Provide a deterministic pseudorandom number. + */ + UtilPrngTransactionBody util_prng = 52; + } + + /** + * A list of maximum custom fees that the users are willing to pay. + */ + repeated CustomFeeLimit max_custom_fees = 1001; +} + +message TransactionList { + repeated Transaction transaction_list = 1; +} \ No newline at end of file diff --git a/packages/proto/package.json b/packages/proto/package.json index 43401bd65b..87fcc9f6f2 100644 --- a/packages/proto/package.json +++ b/packages/proto/package.json @@ -5,6 +5,16 @@ "main": "lib/index.js", "browser": "src/index.js", "types": "lib/index.d.ts", + "typesVersions": { + "*": { + "minimal": [ + "./lib/minimal/index.d.ts" + ], + "minimal/*": [ + "./lib/minimal/*" + ] + } + }, "license": "Apache-2.0", "author": "Launchbadge ", "repository": "https://github.com/hiero-ledger/hiero-sdk-js", @@ -21,6 +31,11 @@ ".": { "import": "./lib/index.js", "require": "./lib/index.js" + }, + "./minimal": { + "import": "./lib/minimal/index.js", + "require": "./lib/minimal/index.js", + "types": "./lib/minimal/index.d.ts" } }, "files": [ diff --git a/packages/proto/src/minimal/atomic_batch_transaction.d.ts b/packages/proto/src/minimal/atomic_batch_transaction.d.ts new file mode 100644 index 0000000000..9af2e8c837 --- /dev/null +++ b/packages/proto/src/minimal/atomic_batch_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_atomic_batch_transaction; + +declare namespace hashgraph_atomic_batch_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for atomic batch. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AtomicBatchTransactionBody. */ + interface IAtomicBatchTransactionBody { + + /** A list of signed bytes that represent the batch transactions. */ + transactions?: (Uint8Array[]|null); + } + + /** A transaction body for handling a set of transactions atomically. */ + class AtomicBatchTransactionBody implements IAtomicBatchTransactionBody { + + /** + * Constructs a new AtomicBatchTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IAtomicBatchTransactionBody); + + /** A list of signed bytes that represent the batch transactions. */ + public transactions: Uint8Array[]; + + /** + * Creates a new AtomicBatchTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns AtomicBatchTransactionBody instance + */ + public static create(properties?: proto.IAtomicBatchTransactionBody): proto.AtomicBatchTransactionBody; + + /** + * Encodes the specified AtomicBatchTransactionBody message. Does not implicitly {@link proto.AtomicBatchTransactionBody.verify|verify} messages. + * @param m AtomicBatchTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAtomicBatchTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AtomicBatchTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AtomicBatchTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AtomicBatchTransactionBody; + + /** + * Gets the default type url for AtomicBatchTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** A transaction body for handling a set of transactions atomically. */ + atomicBatch?: (proto.IAtomicBatchTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for atomic batch. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** A transaction body for handling a set of transactions atomically. */ + public atomicBatch?: (proto.IAtomicBatchTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "atomicBatch"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/atomic_batch_transaction.js b/packages/proto/src/minimal/atomic_batch_transaction.js new file mode 100644 index 0000000000..fb2c84f5f7 --- /dev/null +++ b/packages/proto/src/minimal/atomic_batch_transaction.js @@ -0,0 +1,11122 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_atomic_batch_transaction || ($protobuf.roots.hashgraph_atomic_batch_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for atomic batch. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.AtomicBatchTransactionBody = (function() { + + /** + * Properties of an AtomicBatchTransactionBody. + * @memberof proto + * @interface IAtomicBatchTransactionBody + * @property {Array.|null} [transactions] A list of signed bytes that represent the batch transactions. + */ + + /** + * Constructs a new AtomicBatchTransactionBody. + * @memberof proto + * @classdesc A transaction body for handling a set of transactions atomically. + * @implements IAtomicBatchTransactionBody + * @constructor + * @param {proto.IAtomicBatchTransactionBody=} [p] Properties to set + */ + function AtomicBatchTransactionBody(p) { + this.transactions = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signed bytes that represent the batch transactions. + * @member {Array.} transactions + * @memberof proto.AtomicBatchTransactionBody + * @instance + */ + AtomicBatchTransactionBody.prototype.transactions = $util.emptyArray; + + /** + * Creates a new AtomicBatchTransactionBody instance using the specified properties. + * @function create + * @memberof proto.AtomicBatchTransactionBody + * @static + * @param {proto.IAtomicBatchTransactionBody=} [properties] Properties to set + * @returns {proto.AtomicBatchTransactionBody} AtomicBatchTransactionBody instance + */ + AtomicBatchTransactionBody.create = function create(properties) { + return new AtomicBatchTransactionBody(properties); + }; + + /** + * Encodes the specified AtomicBatchTransactionBody message. Does not implicitly {@link proto.AtomicBatchTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.AtomicBatchTransactionBody + * @static + * @param {proto.IAtomicBatchTransactionBody} m AtomicBatchTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AtomicBatchTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactions != null && m.transactions.length) { + for (var i = 0; i < m.transactions.length; ++i) + w.uint32(10).bytes(m.transactions[i]); + } + return w; + }; + + /** + * Decodes an AtomicBatchTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.AtomicBatchTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AtomicBatchTransactionBody} AtomicBatchTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AtomicBatchTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AtomicBatchTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactions && m.transactions.length)) + m.transactions = []; + m.transactions.push(r.bytes()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AtomicBatchTransactionBody + * @function getTypeUrl + * @memberof proto.AtomicBatchTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AtomicBatchTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AtomicBatchTransactionBody"; + }; + + return AtomicBatchTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IAtomicBatchTransactionBody|null} [atomicBatch] A transaction body for handling a set of transactions atomically. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for atomic batch. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * A transaction body for handling a set of transactions atomically. + * @member {proto.IAtomicBatchTransactionBody|null|undefined} atomicBatch + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.atomicBatch = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"atomicBatch"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["atomicBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.atomicBatch != null && Object.hasOwnProperty.call(m, "atomicBatch")) + $root.proto.AtomicBatchTransactionBody.encode(m.atomicBatch, w.uint32(594).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 74: { + m.atomicBatch = $root.proto.AtomicBatchTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/consensus_create_topic_transaction.d.ts b/packages/proto/src/minimal/consensus_create_topic_transaction.d.ts new file mode 100644 index 0000000000..811dbd5046 --- /dev/null +++ b/packages/proto/src/minimal/consensus_create_topic_transaction.d.ts @@ -0,0 +1,6411 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_consensus_create_topic_transaction; + +declare namespace hashgraph_consensus_create_topic_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for consensus topic creation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a topic. */ + consensusCreateTopic?: (proto.IConsensusCreateTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for consensus topic creation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a topic. */ + public consensusCreateTopic?: (proto.IConsensusCreateTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "consensusCreateTopic"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsensusCreateTopicTransactionBody. */ + interface IConsensusCreateTopicTransactionBody { + + /** Short publicly visible memo about the topic. */ + memo?: (string|null); + + /** Access control for updateTopic/deleteTopic. */ + adminKey?: (proto.IKey|null); + + /** Access control for submitMessage. */ + submitKey?: (proto.IKey|null); + + /** The initial lifetime of the topic and the amount of time to extend the topic's lifetime by. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** An optional account to be used at the topic's expiration time to extend the life of the topic. */ + autoRenewAccount?: (proto.IAccountID|null); + } + + /** Create a new topic. */ + class ConsensusCreateTopicTransactionBody implements IConsensusCreateTopicTransactionBody { + + /** + * Constructs a new ConsensusCreateTopicTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IConsensusCreateTopicTransactionBody); + + /** Short publicly visible memo about the topic. */ + public memo: string; + + /** Access control for updateTopic/deleteTopic. */ + public adminKey?: (proto.IKey|null); + + /** Access control for submitMessage. */ + public submitKey?: (proto.IKey|null); + + /** The initial lifetime of the topic and the amount of time to extend the topic's lifetime by. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** An optional account to be used at the topic's expiration time to extend the life of the topic. */ + public autoRenewAccount?: (proto.IAccountID|null); + + /** + * Creates a new ConsensusCreateTopicTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsensusCreateTopicTransactionBody instance + */ + public static create(properties?: proto.IConsensusCreateTopicTransactionBody): proto.ConsensusCreateTopicTransactionBody; + + /** + * Encodes the specified ConsensusCreateTopicTransactionBody message. Does not implicitly {@link proto.ConsensusCreateTopicTransactionBody.verify|verify} messages. + * @param m ConsensusCreateTopicTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IConsensusCreateTopicTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsensusCreateTopicTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ConsensusCreateTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ConsensusCreateTopicTransactionBody; + + /** + * Gets the default type url for ConsensusCreateTopicTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/consensus_create_topic_transaction.js b/packages/proto/src/minimal/consensus_create_topic_transaction.js new file mode 100644 index 0000000000..cab5dc5670 --- /dev/null +++ b/packages/proto/src/minimal/consensus_create_topic_transaction.js @@ -0,0 +1,11177 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_consensus_create_topic_transaction || ($protobuf.roots.hashgraph_consensus_create_topic_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for consensus topic creation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IConsensusCreateTopicTransactionBody|null} [consensusCreateTopic] Create a topic. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for consensus topic creation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a topic. + * @member {proto.IConsensusCreateTopicTransactionBody|null|undefined} consensusCreateTopic + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.consensusCreateTopic = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"consensusCreateTopic"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["consensusCreateTopic"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.consensusCreateTopic != null && Object.hasOwnProperty.call(m, "consensusCreateTopic")) + $root.proto.ConsensusCreateTopicTransactionBody.encode(m.consensusCreateTopic, w.uint32(194).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 24: { + m.consensusCreateTopic = $root.proto.ConsensusCreateTopicTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ConsensusCreateTopicTransactionBody = (function() { + + /** + * Properties of a ConsensusCreateTopicTransactionBody. + * @memberof proto + * @interface IConsensusCreateTopicTransactionBody + * @property {string|null} [memo] Short publicly visible memo about the topic. + * @property {proto.IKey|null} [adminKey] Access control for updateTopic/deleteTopic. + * @property {proto.IKey|null} [submitKey] Access control for submitMessage. + * @property {proto.IDuration|null} [autoRenewPeriod] The initial lifetime of the topic and the amount of time to extend the topic's lifetime by. + * @property {proto.IAccountID|null} [autoRenewAccount] An optional account to be used at the topic's expiration time to extend the life of the topic. + */ + + /** + * Constructs a new ConsensusCreateTopicTransactionBody. + * @memberof proto + * @classdesc Create a new topic. + * @implements IConsensusCreateTopicTransactionBody + * @constructor + * @param {proto.IConsensusCreateTopicTransactionBody=} [p] Properties to set + */ + function ConsensusCreateTopicTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Short publicly visible memo about the topic. + * @member {string} memo + * @memberof proto.ConsensusCreateTopicTransactionBody + * @instance + */ + ConsensusCreateTopicTransactionBody.prototype.memo = ""; + + /** + * Access control for updateTopic/deleteTopic. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.ConsensusCreateTopicTransactionBody + * @instance + */ + ConsensusCreateTopicTransactionBody.prototype.adminKey = null; + + /** + * Access control for submitMessage. + * @member {proto.IKey|null|undefined} submitKey + * @memberof proto.ConsensusCreateTopicTransactionBody + * @instance + */ + ConsensusCreateTopicTransactionBody.prototype.submitKey = null; + + /** + * The initial lifetime of the topic and the amount of time to extend the topic's lifetime by. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.ConsensusCreateTopicTransactionBody + * @instance + */ + ConsensusCreateTopicTransactionBody.prototype.autoRenewPeriod = null; + + /** + * An optional account to be used at the topic's expiration time to extend the life of the topic. + * @member {proto.IAccountID|null|undefined} autoRenewAccount + * @memberof proto.ConsensusCreateTopicTransactionBody + * @instance + */ + ConsensusCreateTopicTransactionBody.prototype.autoRenewAccount = null; + + /** + * Creates a new ConsensusCreateTopicTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ConsensusCreateTopicTransactionBody + * @static + * @param {proto.IConsensusCreateTopicTransactionBody=} [properties] Properties to set + * @returns {proto.ConsensusCreateTopicTransactionBody} ConsensusCreateTopicTransactionBody instance + */ + ConsensusCreateTopicTransactionBody.create = function create(properties) { + return new ConsensusCreateTopicTransactionBody(properties); + }; + + /** + * Encodes the specified ConsensusCreateTopicTransactionBody message. Does not implicitly {@link proto.ConsensusCreateTopicTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ConsensusCreateTopicTransactionBody + * @static + * @param {proto.IConsensusCreateTopicTransactionBody} m ConsensusCreateTopicTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusCreateTopicTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(10).string(m.memo); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(18).fork()).ldelim(); + if (m.submitKey != null && Object.hasOwnProperty.call(m, "submitKey")) + $root.proto.Key.encode(m.submitKey, w.uint32(26).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(50).fork()).ldelim(); + if (m.autoRenewAccount != null && Object.hasOwnProperty.call(m, "autoRenewAccount")) + $root.proto.AccountID.encode(m.autoRenewAccount, w.uint32(58).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ConsensusCreateTopicTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ConsensusCreateTopicTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ConsensusCreateTopicTransactionBody} ConsensusCreateTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusCreateTopicTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ConsensusCreateTopicTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.memo = r.string(); + break; + } + case 2: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 3: { + m.submitKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 6: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 7: { + m.autoRenewAccount = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ConsensusCreateTopicTransactionBody + * @function getTypeUrl + * @memberof proto.ConsensusCreateTopicTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsensusCreateTopicTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ConsensusCreateTopicTransactionBody"; + }; + + return ConsensusCreateTopicTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/consensus_delete_topic_transaction.d.ts b/packages/proto/src/minimal/consensus_delete_topic_transaction.d.ts new file mode 100644 index 0000000000..cd1587ef59 --- /dev/null +++ b/packages/proto/src/minimal/consensus_delete_topic_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_consensus_delete_topic_transaction; + +declare namespace hashgraph_consensus_delete_topic_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for consensus topic deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a topic. */ + consensusDeleteTopic?: (proto.IConsensusDeleteTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for consensus topic deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a topic. */ + public consensusDeleteTopic?: (proto.IConsensusDeleteTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "consensusDeleteTopic"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsensusDeleteTopicTransactionBody. */ + interface IConsensusDeleteTopicTransactionBody { + + /** Topic identifier. */ + topicID?: (proto.ITopicID|null); + } + + /** Delete a topic. */ + class ConsensusDeleteTopicTransactionBody implements IConsensusDeleteTopicTransactionBody { + + /** + * Constructs a new ConsensusDeleteTopicTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IConsensusDeleteTopicTransactionBody); + + /** Topic identifier. */ + public topicID?: (proto.ITopicID|null); + + /** + * Creates a new ConsensusDeleteTopicTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsensusDeleteTopicTransactionBody instance + */ + public static create(properties?: proto.IConsensusDeleteTopicTransactionBody): proto.ConsensusDeleteTopicTransactionBody; + + /** + * Encodes the specified ConsensusDeleteTopicTransactionBody message. Does not implicitly {@link proto.ConsensusDeleteTopicTransactionBody.verify|verify} messages. + * @param m ConsensusDeleteTopicTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IConsensusDeleteTopicTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsensusDeleteTopicTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ConsensusDeleteTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ConsensusDeleteTopicTransactionBody; + + /** + * Gets the default type url for ConsensusDeleteTopicTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/consensus_delete_topic_transaction.js b/packages/proto/src/minimal/consensus_delete_topic_transaction.js new file mode 100644 index 0000000000..d251b1ccef --- /dev/null +++ b/packages/proto/src/minimal/consensus_delete_topic_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_consensus_delete_topic_transaction || ($protobuf.roots.hashgraph_consensus_delete_topic_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for consensus topic deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IConsensusDeleteTopicTransactionBody|null} [consensusDeleteTopic] Delete a topic. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for consensus topic deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a topic. + * @member {proto.IConsensusDeleteTopicTransactionBody|null|undefined} consensusDeleteTopic + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.consensusDeleteTopic = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"consensusDeleteTopic"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["consensusDeleteTopic"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.consensusDeleteTopic != null && Object.hasOwnProperty.call(m, "consensusDeleteTopic")) + $root.proto.ConsensusDeleteTopicTransactionBody.encode(m.consensusDeleteTopic, w.uint32(210).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 26: { + m.consensusDeleteTopic = $root.proto.ConsensusDeleteTopicTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ConsensusDeleteTopicTransactionBody = (function() { + + /** + * Properties of a ConsensusDeleteTopicTransactionBody. + * @memberof proto + * @interface IConsensusDeleteTopicTransactionBody + * @property {proto.ITopicID|null} [topicID] Topic identifier. + */ + + /** + * Constructs a new ConsensusDeleteTopicTransactionBody. + * @memberof proto + * @classdesc Delete a topic. + * @implements IConsensusDeleteTopicTransactionBody + * @constructor + * @param {proto.IConsensusDeleteTopicTransactionBody=} [p] Properties to set + */ + function ConsensusDeleteTopicTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Topic identifier. + * @member {proto.ITopicID|null|undefined} topicID + * @memberof proto.ConsensusDeleteTopicTransactionBody + * @instance + */ + ConsensusDeleteTopicTransactionBody.prototype.topicID = null; + + /** + * Creates a new ConsensusDeleteTopicTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ConsensusDeleteTopicTransactionBody + * @static + * @param {proto.IConsensusDeleteTopicTransactionBody=} [properties] Properties to set + * @returns {proto.ConsensusDeleteTopicTransactionBody} ConsensusDeleteTopicTransactionBody instance + */ + ConsensusDeleteTopicTransactionBody.create = function create(properties) { + return new ConsensusDeleteTopicTransactionBody(properties); + }; + + /** + * Encodes the specified ConsensusDeleteTopicTransactionBody message. Does not implicitly {@link proto.ConsensusDeleteTopicTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ConsensusDeleteTopicTransactionBody + * @static + * @param {proto.IConsensusDeleteTopicTransactionBody} m ConsensusDeleteTopicTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusDeleteTopicTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.topicID != null && Object.hasOwnProperty.call(m, "topicID")) + $root.proto.TopicID.encode(m.topicID, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ConsensusDeleteTopicTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ConsensusDeleteTopicTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ConsensusDeleteTopicTransactionBody} ConsensusDeleteTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusDeleteTopicTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ConsensusDeleteTopicTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.topicID = $root.proto.TopicID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ConsensusDeleteTopicTransactionBody + * @function getTypeUrl + * @memberof proto.ConsensusDeleteTopicTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsensusDeleteTopicTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ConsensusDeleteTopicTransactionBody"; + }; + + return ConsensusDeleteTopicTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/consensus_submit_message_transaction.d.ts b/packages/proto/src/minimal/consensus_submit_message_transaction.d.ts new file mode 100644 index 0000000000..477c79b4cf --- /dev/null +++ b/packages/proto/src/minimal/consensus_submit_message_transaction.d.ts @@ -0,0 +1,6463 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_consensus_submit_message_transaction; + +declare namespace hashgraph_consensus_submit_message_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for consensus message submission. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Submit a message to a topic. */ + consensusSubmitMessage?: (proto.IConsensusSubmitMessageTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for consensus message submission. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Submit a message to a topic. */ + public consensusSubmitMessage?: (proto.IConsensusSubmitMessageTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "consensusSubmitMessage"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsensusMessageChunkInfo. */ + interface IConsensusMessageChunkInfo { + + /** The TransactionID of the first chunk. */ + initialTransactionID?: (proto.ITransactionID|null); + + /** The total number of chunks in the message. */ + total?: (number|null); + + /** The sequence number (from 1 to total) of the current chunk in the message. */ + number?: (number|null); + } + + /** Information about a chunk in a fragmented message. */ + class ConsensusMessageChunkInfo implements IConsensusMessageChunkInfo { + + /** + * Constructs a new ConsensusMessageChunkInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IConsensusMessageChunkInfo); + + /** The TransactionID of the first chunk. */ + public initialTransactionID?: (proto.ITransactionID|null); + + /** The total number of chunks in the message. */ + public total: number; + + /** The sequence number (from 1 to total) of the current chunk in the message. */ + public number: number; + + /** + * Creates a new ConsensusMessageChunkInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsensusMessageChunkInfo instance + */ + public static create(properties?: proto.IConsensusMessageChunkInfo): proto.ConsensusMessageChunkInfo; + + /** + * Encodes the specified ConsensusMessageChunkInfo message. Does not implicitly {@link proto.ConsensusMessageChunkInfo.verify|verify} messages. + * @param m ConsensusMessageChunkInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IConsensusMessageChunkInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsensusMessageChunkInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ConsensusMessageChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ConsensusMessageChunkInfo; + + /** + * Gets the default type url for ConsensusMessageChunkInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsensusSubmitMessageTransactionBody. */ + interface IConsensusSubmitMessageTransactionBody { + + /** Topic to submit message to. */ + topicID?: (proto.ITopicID|null); + + /** Message to be submitted. */ + message?: (Uint8Array|null); + + /** Optional information about the current chunk in a fragmented message. */ + chunkInfo?: (proto.IConsensusMessageChunkInfo|null); + } + + /** Submit a message to a topic. */ + class ConsensusSubmitMessageTransactionBody implements IConsensusSubmitMessageTransactionBody { + + /** + * Constructs a new ConsensusSubmitMessageTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IConsensusSubmitMessageTransactionBody); + + /** Topic to submit message to. */ + public topicID?: (proto.ITopicID|null); + + /** Message to be submitted. */ + public message: Uint8Array; + + /** Optional information about the current chunk in a fragmented message. */ + public chunkInfo?: (proto.IConsensusMessageChunkInfo|null); + + /** + * Creates a new ConsensusSubmitMessageTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsensusSubmitMessageTransactionBody instance + */ + public static create(properties?: proto.IConsensusSubmitMessageTransactionBody): proto.ConsensusSubmitMessageTransactionBody; + + /** + * Encodes the specified ConsensusSubmitMessageTransactionBody message. Does not implicitly {@link proto.ConsensusSubmitMessageTransactionBody.verify|verify} messages. + * @param m ConsensusSubmitMessageTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IConsensusSubmitMessageTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsensusSubmitMessageTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ConsensusSubmitMessageTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ConsensusSubmitMessageTransactionBody; + + /** + * Gets the default type url for ConsensusSubmitMessageTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/consensus_submit_message_transaction.js b/packages/proto/src/minimal/consensus_submit_message_transaction.js new file mode 100644 index 0000000000..02f50f673e --- /dev/null +++ b/packages/proto/src/minimal/consensus_submit_message_transaction.js @@ -0,0 +1,11286 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_consensus_submit_message_transaction || ($protobuf.roots.hashgraph_consensus_submit_message_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for consensus message submission. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IConsensusSubmitMessageTransactionBody|null} [consensusSubmitMessage] Submit a message to a topic. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for consensus message submission. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Submit a message to a topic. + * @member {proto.IConsensusSubmitMessageTransactionBody|null|undefined} consensusSubmitMessage + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.consensusSubmitMessage = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"consensusSubmitMessage"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["consensusSubmitMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.consensusSubmitMessage != null && Object.hasOwnProperty.call(m, "consensusSubmitMessage")) + $root.proto.ConsensusSubmitMessageTransactionBody.encode(m.consensusSubmitMessage, w.uint32(218).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 27: { + m.consensusSubmitMessage = $root.proto.ConsensusSubmitMessageTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ConsensusMessageChunkInfo = (function() { + + /** + * Properties of a ConsensusMessageChunkInfo. + * @memberof proto + * @interface IConsensusMessageChunkInfo + * @property {proto.ITransactionID|null} [initialTransactionID] The TransactionID of the first chunk. + * @property {number|null} [total] The total number of chunks in the message. + * @property {number|null} [number] The sequence number (from 1 to total) of the current chunk in the message. + */ + + /** + * Constructs a new ConsensusMessageChunkInfo. + * @memberof proto + * @classdesc Information about a chunk in a fragmented message. + * @implements IConsensusMessageChunkInfo + * @constructor + * @param {proto.IConsensusMessageChunkInfo=} [p] Properties to set + */ + function ConsensusMessageChunkInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The TransactionID of the first chunk. + * @member {proto.ITransactionID|null|undefined} initialTransactionID + * @memberof proto.ConsensusMessageChunkInfo + * @instance + */ + ConsensusMessageChunkInfo.prototype.initialTransactionID = null; + + /** + * The total number of chunks in the message. + * @member {number} total + * @memberof proto.ConsensusMessageChunkInfo + * @instance + */ + ConsensusMessageChunkInfo.prototype.total = 0; + + /** + * The sequence number (from 1 to total) of the current chunk in the message. + * @member {number} number + * @memberof proto.ConsensusMessageChunkInfo + * @instance + */ + ConsensusMessageChunkInfo.prototype.number = 0; + + /** + * Creates a new ConsensusMessageChunkInfo instance using the specified properties. + * @function create + * @memberof proto.ConsensusMessageChunkInfo + * @static + * @param {proto.IConsensusMessageChunkInfo=} [properties] Properties to set + * @returns {proto.ConsensusMessageChunkInfo} ConsensusMessageChunkInfo instance + */ + ConsensusMessageChunkInfo.create = function create(properties) { + return new ConsensusMessageChunkInfo(properties); + }; + + /** + * Encodes the specified ConsensusMessageChunkInfo message. Does not implicitly {@link proto.ConsensusMessageChunkInfo.verify|verify} messages. + * @function encode + * @memberof proto.ConsensusMessageChunkInfo + * @static + * @param {proto.IConsensusMessageChunkInfo} m ConsensusMessageChunkInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusMessageChunkInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.initialTransactionID != null && Object.hasOwnProperty.call(m, "initialTransactionID")) + $root.proto.TransactionID.encode(m.initialTransactionID, w.uint32(10).fork()).ldelim(); + if (m.total != null && Object.hasOwnProperty.call(m, "total")) + w.uint32(16).int32(m.total); + if (m.number != null && Object.hasOwnProperty.call(m, "number")) + w.uint32(24).int32(m.number); + return w; + }; + + /** + * Decodes a ConsensusMessageChunkInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.ConsensusMessageChunkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ConsensusMessageChunkInfo} ConsensusMessageChunkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusMessageChunkInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ConsensusMessageChunkInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.initialTransactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.total = r.int32(); + break; + } + case 3: { + m.number = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ConsensusMessageChunkInfo + * @function getTypeUrl + * @memberof proto.ConsensusMessageChunkInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsensusMessageChunkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ConsensusMessageChunkInfo"; + }; + + return ConsensusMessageChunkInfo; + })(); + + proto.ConsensusSubmitMessageTransactionBody = (function() { + + /** + * Properties of a ConsensusSubmitMessageTransactionBody. + * @memberof proto + * @interface IConsensusSubmitMessageTransactionBody + * @property {proto.ITopicID|null} [topicID] Topic to submit message to. + * @property {Uint8Array|null} [message] Message to be submitted. + * @property {proto.IConsensusMessageChunkInfo|null} [chunkInfo] Optional information about the current chunk in a fragmented message. + */ + + /** + * Constructs a new ConsensusSubmitMessageTransactionBody. + * @memberof proto + * @classdesc Submit a message to a topic. + * @implements IConsensusSubmitMessageTransactionBody + * @constructor + * @param {proto.IConsensusSubmitMessageTransactionBody=} [p] Properties to set + */ + function ConsensusSubmitMessageTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Topic to submit message to. + * @member {proto.ITopicID|null|undefined} topicID + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @instance + */ + ConsensusSubmitMessageTransactionBody.prototype.topicID = null; + + /** + * Message to be submitted. + * @member {Uint8Array} message + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @instance + */ + ConsensusSubmitMessageTransactionBody.prototype.message = $util.newBuffer([]); + + /** + * Optional information about the current chunk in a fragmented message. + * @member {proto.IConsensusMessageChunkInfo|null|undefined} chunkInfo + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @instance + */ + ConsensusSubmitMessageTransactionBody.prototype.chunkInfo = null; + + /** + * Creates a new ConsensusSubmitMessageTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @static + * @param {proto.IConsensusSubmitMessageTransactionBody=} [properties] Properties to set + * @returns {proto.ConsensusSubmitMessageTransactionBody} ConsensusSubmitMessageTransactionBody instance + */ + ConsensusSubmitMessageTransactionBody.create = function create(properties) { + return new ConsensusSubmitMessageTransactionBody(properties); + }; + + /** + * Encodes the specified ConsensusSubmitMessageTransactionBody message. Does not implicitly {@link proto.ConsensusSubmitMessageTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @static + * @param {proto.IConsensusSubmitMessageTransactionBody} m ConsensusSubmitMessageTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusSubmitMessageTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.topicID != null && Object.hasOwnProperty.call(m, "topicID")) + $root.proto.TopicID.encode(m.topicID, w.uint32(10).fork()).ldelim(); + if (m.message != null && Object.hasOwnProperty.call(m, "message")) + w.uint32(18).bytes(m.message); + if (m.chunkInfo != null && Object.hasOwnProperty.call(m, "chunkInfo")) + $root.proto.ConsensusMessageChunkInfo.encode(m.chunkInfo, w.uint32(26).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ConsensusSubmitMessageTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ConsensusSubmitMessageTransactionBody} ConsensusSubmitMessageTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusSubmitMessageTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ConsensusSubmitMessageTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.topicID = $root.proto.TopicID.decode(r, r.uint32()); + break; + } + case 2: { + m.message = r.bytes(); + break; + } + case 3: { + m.chunkInfo = $root.proto.ConsensusMessageChunkInfo.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ConsensusSubmitMessageTransactionBody + * @function getTypeUrl + * @memberof proto.ConsensusSubmitMessageTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsensusSubmitMessageTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ConsensusSubmitMessageTransactionBody"; + }; + + return ConsensusSubmitMessageTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/consensus_update_topic_transaction.d.ts b/packages/proto/src/minimal/consensus_update_topic_transaction.d.ts new file mode 100644 index 0000000000..96b1a49254 --- /dev/null +++ b/packages/proto/src/minimal/consensus_update_topic_transaction.d.ts @@ -0,0 +1,6423 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_consensus_update_topic_transaction; + +declare namespace hashgraph_consensus_update_topic_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for consensus topic updates. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update a topic. */ + consensusUpdateTopic?: (proto.IConsensusUpdateTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for consensus topic updates. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update a topic. */ + public consensusUpdateTopic?: (proto.IConsensusUpdateTopicTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "consensusUpdateTopic"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConsensusUpdateTopicTransactionBody. */ + interface IConsensusUpdateTopicTransactionBody { + + /** The topic to update. */ + topicID?: (proto.ITopicID|null); + + /** Short publicly visible memo about the topic. */ + memo?: (string|null); + + /** Effective consensus timestamp at (and after) which all consensus transactions and queries will expire. */ + expirationTime?: (proto.ITimestamp|null); + + /** Access control for updateTopic/deleteTopic. */ + adminKey?: (proto.IKey|null); + + /** Access control for submitMessage. */ + submitKey?: (proto.IKey|null); + + /** The amount of time to extend the topic's lifetime automatically at expiration time. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** Optional account to be used at the topic's expiration time to extend the life of the topic. */ + autoRenewAccount?: (proto.IAccountID|null); + } + + /** Update a topic. */ + class ConsensusUpdateTopicTransactionBody implements IConsensusUpdateTopicTransactionBody { + + /** + * Constructs a new ConsensusUpdateTopicTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IConsensusUpdateTopicTransactionBody); + + /** The topic to update. */ + public topicID?: (proto.ITopicID|null); + + /** Short publicly visible memo about the topic. */ + public memo: string; + + /** Effective consensus timestamp at (and after) which all consensus transactions and queries will expire. */ + public expirationTime?: (proto.ITimestamp|null); + + /** Access control for updateTopic/deleteTopic. */ + public adminKey?: (proto.IKey|null); + + /** Access control for submitMessage. */ + public submitKey?: (proto.IKey|null); + + /** The amount of time to extend the topic's lifetime automatically at expiration time. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** Optional account to be used at the topic's expiration time to extend the life of the topic. */ + public autoRenewAccount?: (proto.IAccountID|null); + + /** + * Creates a new ConsensusUpdateTopicTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsensusUpdateTopicTransactionBody instance + */ + public static create(properties?: proto.IConsensusUpdateTopicTransactionBody): proto.ConsensusUpdateTopicTransactionBody; + + /** + * Encodes the specified ConsensusUpdateTopicTransactionBody message. Does not implicitly {@link proto.ConsensusUpdateTopicTransactionBody.verify|verify} messages. + * @param m ConsensusUpdateTopicTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IConsensusUpdateTopicTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsensusUpdateTopicTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ConsensusUpdateTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ConsensusUpdateTopicTransactionBody; + + /** + * Gets the default type url for ConsensusUpdateTopicTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/consensus_update_topic_transaction.js b/packages/proto/src/minimal/consensus_update_topic_transaction.js new file mode 100644 index 0000000000..3b46a72822 --- /dev/null +++ b/packages/proto/src/minimal/consensus_update_topic_transaction.js @@ -0,0 +1,11207 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_consensus_update_topic_transaction || ($protobuf.roots.hashgraph_consensus_update_topic_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for consensus topic updates. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IConsensusUpdateTopicTransactionBody|null} [consensusUpdateTopic] Update a topic. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for consensus topic updates. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update a topic. + * @member {proto.IConsensusUpdateTopicTransactionBody|null|undefined} consensusUpdateTopic + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.consensusUpdateTopic = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"consensusUpdateTopic"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["consensusUpdateTopic"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.consensusUpdateTopic != null && Object.hasOwnProperty.call(m, "consensusUpdateTopic")) + $root.proto.ConsensusUpdateTopicTransactionBody.encode(m.consensusUpdateTopic, w.uint32(202).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 25: { + m.consensusUpdateTopic = $root.proto.ConsensusUpdateTopicTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ConsensusUpdateTopicTransactionBody = (function() { + + /** + * Properties of a ConsensusUpdateTopicTransactionBody. + * @memberof proto + * @interface IConsensusUpdateTopicTransactionBody + * @property {proto.ITopicID|null} [topicID] The topic to update. + * @property {string|null} [memo] Short publicly visible memo about the topic. + * @property {proto.ITimestamp|null} [expirationTime] Effective consensus timestamp at (and after) which all consensus transactions and queries will expire. + * @property {proto.IKey|null} [adminKey] Access control for updateTopic/deleteTopic. + * @property {proto.IKey|null} [submitKey] Access control for submitMessage. + * @property {proto.IDuration|null} [autoRenewPeriod] The amount of time to extend the topic's lifetime automatically at expiration time. + * @property {proto.IAccountID|null} [autoRenewAccount] Optional account to be used at the topic's expiration time to extend the life of the topic. + */ + + /** + * Constructs a new ConsensusUpdateTopicTransactionBody. + * @memberof proto + * @classdesc Update a topic. + * @implements IConsensusUpdateTopicTransactionBody + * @constructor + * @param {proto.IConsensusUpdateTopicTransactionBody=} [p] Properties to set + */ + function ConsensusUpdateTopicTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The topic to update. + * @member {proto.ITopicID|null|undefined} topicID + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.topicID = null; + + /** + * Short publicly visible memo about the topic. + * @member {string} memo + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.memo = ""; + + /** + * Effective consensus timestamp at (and after) which all consensus transactions and queries will expire. + * @member {proto.ITimestamp|null|undefined} expirationTime + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.expirationTime = null; + + /** + * Access control for updateTopic/deleteTopic. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.adminKey = null; + + /** + * Access control for submitMessage. + * @member {proto.IKey|null|undefined} submitKey + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.submitKey = null; + + /** + * The amount of time to extend the topic's lifetime automatically at expiration time. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.autoRenewPeriod = null; + + /** + * Optional account to be used at the topic's expiration time to extend the life of the topic. + * @member {proto.IAccountID|null|undefined} autoRenewAccount + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @instance + */ + ConsensusUpdateTopicTransactionBody.prototype.autoRenewAccount = null; + + /** + * Creates a new ConsensusUpdateTopicTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @static + * @param {proto.IConsensusUpdateTopicTransactionBody=} [properties] Properties to set + * @returns {proto.ConsensusUpdateTopicTransactionBody} ConsensusUpdateTopicTransactionBody instance + */ + ConsensusUpdateTopicTransactionBody.create = function create(properties) { + return new ConsensusUpdateTopicTransactionBody(properties); + }; + + /** + * Encodes the specified ConsensusUpdateTopicTransactionBody message. Does not implicitly {@link proto.ConsensusUpdateTopicTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @static + * @param {proto.IConsensusUpdateTopicTransactionBody} m ConsensusUpdateTopicTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusUpdateTopicTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.topicID != null && Object.hasOwnProperty.call(m, "topicID")) + $root.proto.TopicID.encode(m.topicID, w.uint32(10).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(18).string(m.memo); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.Timestamp.encode(m.expirationTime, w.uint32(34).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(50).fork()).ldelim(); + if (m.submitKey != null && Object.hasOwnProperty.call(m, "submitKey")) + $root.proto.Key.encode(m.submitKey, w.uint32(58).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(66).fork()).ldelim(); + if (m.autoRenewAccount != null && Object.hasOwnProperty.call(m, "autoRenewAccount")) + $root.proto.AccountID.encode(m.autoRenewAccount, w.uint32(74).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ConsensusUpdateTopicTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ConsensusUpdateTopicTransactionBody} ConsensusUpdateTopicTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusUpdateTopicTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ConsensusUpdateTopicTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.topicID = $root.proto.TopicID.decode(r, r.uint32()); + break; + } + case 2: { + m.memo = r.string(); + break; + } + case 4: { + m.expirationTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 6: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 7: { + m.submitKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 9: { + m.autoRenewAccount = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ConsensusUpdateTopicTransactionBody + * @function getTypeUrl + * @memberof proto.ConsensusUpdateTopicTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConsensusUpdateTopicTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ConsensusUpdateTopicTransactionBody"; + }; + + return ConsensusUpdateTopicTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/contract_call_transaction.d.ts b/packages/proto/src/minimal/contract_call_transaction.d.ts new file mode 100644 index 0000000000..45cc3a18f7 --- /dev/null +++ b/packages/proto/src/minimal/contract_call_transaction.d.ts @@ -0,0 +1,6405 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_contract_call_transaction; + +declare namespace hashgraph_contract_call_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for contract calls. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Call a function defined on a smart contract. */ + contractCall?: (proto.IContractCallTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for contract calls. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Call a function defined on a smart contract. */ + public contractCall?: (proto.IContractCallTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "contractCall"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractCallTransactionBody. */ + interface IContractCallTransactionBody { + + /** The ID of a smart contract to call. */ + contractID?: (proto.IContractID|null); + + /** A maximum limit to the amount of gas to use for this call. */ + gas?: (Long|null); + + /** Number of tinybars sent as the "value" for this call. */ + amount?: (Long|null); + + /** Which function to call, and the parameters to pass to the function. */ + functionParameters?: (Uint8Array|null); + } + + /** Call a function of a given smart contract. */ + class ContractCallTransactionBody implements IContractCallTransactionBody { + + /** + * Constructs a new ContractCallTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractCallTransactionBody); + + /** The ID of a smart contract to call. */ + public contractID?: (proto.IContractID|null); + + /** A maximum limit to the amount of gas to use for this call. */ + public gas: Long; + + /** Number of tinybars sent as the "value" for this call. */ + public amount: Long; + + /** Which function to call, and the parameters to pass to the function. */ + public functionParameters: Uint8Array; + + /** + * Creates a new ContractCallTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractCallTransactionBody instance + */ + public static create(properties?: proto.IContractCallTransactionBody): proto.ContractCallTransactionBody; + + /** + * Encodes the specified ContractCallTransactionBody message. Does not implicitly {@link proto.ContractCallTransactionBody.verify|verify} messages. + * @param m ContractCallTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractCallTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractCallTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractCallTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractCallTransactionBody; + + /** + * Gets the default type url for ContractCallTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/contract_call_transaction.js b/packages/proto/src/minimal/contract_call_transaction.js new file mode 100644 index 0000000000..25580a0624 --- /dev/null +++ b/packages/proto/src/minimal/contract_call_transaction.js @@ -0,0 +1,11162 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_contract_call_transaction || ($protobuf.roots.hashgraph_contract_call_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for contract calls. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IContractCallTransactionBody|null} [contractCall] Call a function defined on a smart contract. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for contract calls. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Call a function defined on a smart contract. + * @member {proto.IContractCallTransactionBody|null|undefined} contractCall + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.contractCall = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"contractCall"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["contractCall"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.contractCall != null && Object.hasOwnProperty.call(m, "contractCall")) + $root.proto.ContractCallTransactionBody.encode(m.contractCall, w.uint32(58).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 7: { + m.contractCall = $root.proto.ContractCallTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ContractCallTransactionBody = (function() { + + /** + * Properties of a ContractCallTransactionBody. + * @memberof proto + * @interface IContractCallTransactionBody + * @property {proto.IContractID|null} [contractID] The ID of a smart contract to call. + * @property {Long|null} [gas] A maximum limit to the amount of gas to use for this call. + * @property {Long|null} [amount] Number of tinybars sent as the "value" for this call. + * @property {Uint8Array|null} [functionParameters] Which function to call, and the parameters to pass to the function. + */ + + /** + * Constructs a new ContractCallTransactionBody. + * @memberof proto + * @classdesc Call a function of a given smart contract. + * @implements IContractCallTransactionBody + * @constructor + * @param {proto.IContractCallTransactionBody=} [p] Properties to set + */ + function ContractCallTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The ID of a smart contract to call. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.ContractCallTransactionBody + * @instance + */ + ContractCallTransactionBody.prototype.contractID = null; + + /** + * A maximum limit to the amount of gas to use for this call. + * @member {Long} gas + * @memberof proto.ContractCallTransactionBody + * @instance + */ + ContractCallTransactionBody.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Number of tinybars sent as the "value" for this call. + * @member {Long} amount + * @memberof proto.ContractCallTransactionBody + * @instance + */ + ContractCallTransactionBody.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Which function to call, and the parameters to pass to the function. + * @member {Uint8Array} functionParameters + * @memberof proto.ContractCallTransactionBody + * @instance + */ + ContractCallTransactionBody.prototype.functionParameters = $util.newBuffer([]); + + /** + * Creates a new ContractCallTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ContractCallTransactionBody + * @static + * @param {proto.IContractCallTransactionBody=} [properties] Properties to set + * @returns {proto.ContractCallTransactionBody} ContractCallTransactionBody instance + */ + ContractCallTransactionBody.create = function create(properties) { + return new ContractCallTransactionBody(properties); + }; + + /** + * Encodes the specified ContractCallTransactionBody message. Does not implicitly {@link proto.ContractCallTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ContractCallTransactionBody + * @static + * @param {proto.IContractCallTransactionBody} m ContractCallTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractCallTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(16).int64(m.gas); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(24).int64(m.amount); + if (m.functionParameters != null && Object.hasOwnProperty.call(m, "functionParameters")) + w.uint32(34).bytes(m.functionParameters); + return w; + }; + + /** + * Decodes a ContractCallTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractCallTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractCallTransactionBody} ContractCallTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractCallTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractCallTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.gas = r.int64(); + break; + } + case 3: { + m.amount = r.int64(); + break; + } + case 4: { + m.functionParameters = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractCallTransactionBody + * @function getTypeUrl + * @memberof proto.ContractCallTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractCallTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractCallTransactionBody"; + }; + + return ContractCallTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/contract_create_transaction.d.ts b/packages/proto/src/minimal/contract_create_transaction.d.ts new file mode 100644 index 0000000000..7efae50fb7 --- /dev/null +++ b/packages/proto/src/minimal/contract_create_transaction.d.ts @@ -0,0 +1,6480 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_contract_create_transaction; + +declare namespace hashgraph_contract_create_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for contract creation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a smart contract. */ + contractCreateInstance?: (proto.IContractCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for contract creation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a smart contract. */ + public contractCreateInstance?: (proto.IContractCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "contractCreateInstance"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractCreateTransactionBody. */ + interface IContractCreateTransactionBody { + + /** The file containing the bytecode for this contract. */ + fileID?: (proto.IFileID|null); + + /** The admin key for this contract. */ + adminKey?: (proto.IKey|null); + + /** Gas to be used for this contract creation. */ + gas?: (Long|null); + + /** Initial balance to be deposited into the contract. */ + initialBalance?: (Long|null); + + /** If the contract requires a proxy account, specify it here. */ + proxyAccountID?: (proto.IAccountID|null); + + /** The period that the instance will charge its account every this many seconds. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** The bytes that are the parameters to pass to the constructor. */ + constructorParameters?: (Uint8Array|null); + + /** The shard in which this contract is created. */ + shardID?: (proto.IShardID|null); + + /** The realm in which this contract is created. */ + realmID?: (proto.IRealmID|null); + + /** If realmID is specified, then this the admin key for that realm. */ + newRealmAdminKey?: (proto.IKey|null); + + /** The memo associated with this contract. */ + memo?: (string|null); + + /** The maximum number of tokens that this contract can be automatically associated with. */ + maxAutomaticTokenAssociations?: (number|null); + + /** An account to charge for auto-renewal of this contract. */ + autoRenewAccountId?: (proto.IAccountID|null); + + /** ID of the account to which this contract is staking. */ + stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this contract is staked to. */ + stakedNodeId?: (Long|null); + + /** If set to the sentinel value of -1, then this contract declines receiving a staking reward. */ + declineReward?: (boolean|null); + } + + /** Create a new smart contract. */ + class ContractCreateTransactionBody implements IContractCreateTransactionBody { + + /** + * Constructs a new ContractCreateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractCreateTransactionBody); + + /** The file containing the bytecode for this contract. */ + public fileID?: (proto.IFileID|null); + + /** The admin key for this contract. */ + public adminKey?: (proto.IKey|null); + + /** Gas to be used for this contract creation. */ + public gas: Long; + + /** Initial balance to be deposited into the contract. */ + public initialBalance: Long; + + /** If the contract requires a proxy account, specify it here. */ + public proxyAccountID?: (proto.IAccountID|null); + + /** The period that the instance will charge its account every this many seconds. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** The bytes that are the parameters to pass to the constructor. */ + public constructorParameters: Uint8Array; + + /** The shard in which this contract is created. */ + public shardID?: (proto.IShardID|null); + + /** The realm in which this contract is created. */ + public realmID?: (proto.IRealmID|null); + + /** If realmID is specified, then this the admin key for that realm. */ + public newRealmAdminKey?: (proto.IKey|null); + + /** The memo associated with this contract. */ + public memo: string; + + /** The maximum number of tokens that this contract can be automatically associated with. */ + public maxAutomaticTokenAssociations: number; + + /** An account to charge for auto-renewal of this contract. */ + public autoRenewAccountId?: (proto.IAccountID|null); + + /** ID of the account to which this contract is staking. */ + public stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this contract is staked to. */ + public stakedNodeId?: (Long|null); + + /** If set to the sentinel value of -1, then this contract declines receiving a staking reward. */ + public declineReward: boolean; + + /** ContractCreateTransactionBody stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new ContractCreateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractCreateTransactionBody instance + */ + public static create(properties?: proto.IContractCreateTransactionBody): proto.ContractCreateTransactionBody; + + /** + * Encodes the specified ContractCreateTransactionBody message. Does not implicitly {@link proto.ContractCreateTransactionBody.verify|verify} messages. + * @param m ContractCreateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractCreateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractCreateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractCreateTransactionBody; + + /** + * Gets the default type url for ContractCreateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/contract_create_transaction.js b/packages/proto/src/minimal/contract_create_transaction.js new file mode 100644 index 0000000000..0577d5cbb2 --- /dev/null +++ b/packages/proto/src/minimal/contract_create_transaction.js @@ -0,0 +1,11356 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_contract_create_transaction || ($protobuf.roots.hashgraph_contract_create_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for contract creation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IContractCreateTransactionBody|null} [contractCreateInstance] Create a smart contract. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for contract creation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a smart contract. + * @member {proto.IContractCreateTransactionBody|null|undefined} contractCreateInstance + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.contractCreateInstance = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"contractCreateInstance"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["contractCreateInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.contractCreateInstance != null && Object.hasOwnProperty.call(m, "contractCreateInstance")) + $root.proto.ContractCreateTransactionBody.encode(m.contractCreateInstance, w.uint32(66).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.contractCreateInstance = $root.proto.ContractCreateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ContractCreateTransactionBody = (function() { + + /** + * Properties of a ContractCreateTransactionBody. + * @memberof proto + * @interface IContractCreateTransactionBody + * @property {proto.IFileID|null} [fileID] The file containing the bytecode for this contract. + * @property {proto.IKey|null} [adminKey] The admin key for this contract. + * @property {Long|null} [gas] Gas to be used for this contract creation. + * @property {Long|null} [initialBalance] Initial balance to be deposited into the contract. + * @property {proto.IAccountID|null} [proxyAccountID] If the contract requires a proxy account, specify it here. + * @property {proto.IDuration|null} [autoRenewPeriod] The period that the instance will charge its account every this many seconds. + * @property {Uint8Array|null} [constructorParameters] The bytes that are the parameters to pass to the constructor. + * @property {proto.IShardID|null} [shardID] The shard in which this contract is created. + * @property {proto.IRealmID|null} [realmID] The realm in which this contract is created. + * @property {proto.IKey|null} [newRealmAdminKey] If realmID is specified, then this the admin key for that realm. + * @property {string|null} [memo] The memo associated with this contract. + * @property {number|null} [maxAutomaticTokenAssociations] The maximum number of tokens that this contract can be automatically associated with. + * @property {proto.IAccountID|null} [autoRenewAccountId] An account to charge for auto-renewal of this contract. + * @property {proto.IAccountID|null} [stakedAccountId] ID of the account to which this contract is staking. + * @property {Long|null} [stakedNodeId] ID of the node this contract is staked to. + * @property {boolean|null} [declineReward] If set to the sentinel value of -1, then this contract declines receiving a staking reward. + */ + + /** + * Constructs a new ContractCreateTransactionBody. + * @memberof proto + * @classdesc Create a new smart contract. + * @implements IContractCreateTransactionBody + * @constructor + * @param {proto.IContractCreateTransactionBody=} [p] Properties to set + */ + function ContractCreateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The file containing the bytecode for this contract. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.fileID = null; + + /** + * The admin key for this contract. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.adminKey = null; + + /** + * Gas to be used for this contract creation. + * @member {Long} gas + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Initial balance to be deposited into the contract. + * @member {Long} initialBalance + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.initialBalance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * If the contract requires a proxy account, specify it here. + * @member {proto.IAccountID|null|undefined} proxyAccountID + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.proxyAccountID = null; + + /** + * The period that the instance will charge its account every this many seconds. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * The bytes that are the parameters to pass to the constructor. + * @member {Uint8Array} constructorParameters + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.constructorParameters = $util.newBuffer([]); + + /** + * The shard in which this contract is created. + * @member {proto.IShardID|null|undefined} shardID + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.shardID = null; + + /** + * The realm in which this contract is created. + * @member {proto.IRealmID|null|undefined} realmID + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.realmID = null; + + /** + * If realmID is specified, then this the admin key for that realm. + * @member {proto.IKey|null|undefined} newRealmAdminKey + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.newRealmAdminKey = null; + + /** + * The memo associated with this contract. + * @member {string} memo + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.memo = ""; + + /** + * The maximum number of tokens that this contract can be automatically associated with. + * @member {number} maxAutomaticTokenAssociations + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.maxAutomaticTokenAssociations = 0; + + /** + * An account to charge for auto-renewal of this contract. + * @member {proto.IAccountID|null|undefined} autoRenewAccountId + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.autoRenewAccountId = null; + + /** + * ID of the account to which this contract is staking. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.stakedAccountId = null; + + /** + * ID of the node this contract is staked to. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.stakedNodeId = null; + + /** + * If set to the sentinel value of -1, then this contract declines receiving a staking reward. + * @member {boolean} declineReward + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + ContractCreateTransactionBody.prototype.declineReward = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractCreateTransactionBody stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.ContractCreateTransactionBody + * @instance + */ + Object.defineProperty(ContractCreateTransactionBody.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractCreateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ContractCreateTransactionBody + * @static + * @param {proto.IContractCreateTransactionBody=} [properties] Properties to set + * @returns {proto.ContractCreateTransactionBody} ContractCreateTransactionBody instance + */ + ContractCreateTransactionBody.create = function create(properties) { + return new ContractCreateTransactionBody(properties); + }; + + /** + * Encodes the specified ContractCreateTransactionBody message. Does not implicitly {@link proto.ContractCreateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ContractCreateTransactionBody + * @static + * @param {proto.IContractCreateTransactionBody} m ContractCreateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractCreateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(10).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(26).fork()).ldelim(); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(32).int64(m.gas); + if (m.initialBalance != null && Object.hasOwnProperty.call(m, "initialBalance")) + w.uint32(40).int64(m.initialBalance); + if (m.proxyAccountID != null && Object.hasOwnProperty.call(m, "proxyAccountID")) + $root.proto.AccountID.encode(m.proxyAccountID, w.uint32(50).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(66).fork()).ldelim(); + if (m.constructorParameters != null && Object.hasOwnProperty.call(m, "constructorParameters")) + w.uint32(74).bytes(m.constructorParameters); + if (m.shardID != null && Object.hasOwnProperty.call(m, "shardID")) + $root.proto.ShardID.encode(m.shardID, w.uint32(82).fork()).ldelim(); + if (m.realmID != null && Object.hasOwnProperty.call(m, "realmID")) + $root.proto.RealmID.encode(m.realmID, w.uint32(90).fork()).ldelim(); + if (m.newRealmAdminKey != null && Object.hasOwnProperty.call(m, "newRealmAdminKey")) + $root.proto.Key.encode(m.newRealmAdminKey, w.uint32(98).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(106).string(m.memo); + if (m.maxAutomaticTokenAssociations != null && Object.hasOwnProperty.call(m, "maxAutomaticTokenAssociations")) + w.uint32(112).int32(m.maxAutomaticTokenAssociations); + if (m.autoRenewAccountId != null && Object.hasOwnProperty.call(m, "autoRenewAccountId")) + $root.proto.AccountID.encode(m.autoRenewAccountId, w.uint32(122).fork()).ldelim(); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(130).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(136).int64(m.stakedNodeId); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(144).bool(m.declineReward); + return w; + }; + + /** + * Decodes a ContractCreateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractCreateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractCreateTransactionBody} ContractCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractCreateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractCreateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 3: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 4: { + m.gas = r.int64(); + break; + } + case 5: { + m.initialBalance = r.int64(); + break; + } + case 6: { + m.proxyAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 8: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 9: { + m.constructorParameters = r.bytes(); + break; + } + case 10: { + m.shardID = $root.proto.ShardID.decode(r, r.uint32()); + break; + } + case 11: { + m.realmID = $root.proto.RealmID.decode(r, r.uint32()); + break; + } + case 12: { + m.newRealmAdminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 13: { + m.memo = r.string(); + break; + } + case 14: { + m.maxAutomaticTokenAssociations = r.int32(); + break; + } + case 15: { + m.autoRenewAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 16: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 17: { + m.stakedNodeId = r.int64(); + break; + } + case 18: { + m.declineReward = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractCreateTransactionBody + * @function getTypeUrl + * @memberof proto.ContractCreateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractCreateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractCreateTransactionBody"; + }; + + return ContractCreateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/contract_delete_transaction.d.ts b/packages/proto/src/minimal/contract_delete_transaction.d.ts new file mode 100644 index 0000000000..66a88e6e79 --- /dev/null +++ b/packages/proto/src/minimal/contract_delete_transaction.d.ts @@ -0,0 +1,6408 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_contract_delete_transaction; + +declare namespace hashgraph_contract_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for contract deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a smart contract and transfer remaining balance to a specified account. */ + contractDeleteInstance?: (proto.IContractDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for contract deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a smart contract and transfer remaining balance to a specified account. */ + public contractDeleteInstance?: (proto.IContractDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "contractDeleteInstance"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractDeleteTransactionBody. */ + interface IContractDeleteTransactionBody { + + /** The contract to delete. */ + contractID?: (proto.IContractID|null); + + /** The account to receive any remaining hbars from the deleted contract. */ + transferAccountID?: (proto.IAccountID|null); + + /** The contract to receive any remaining hbars from the deleted contract. */ + transferContractID?: (proto.IContractID|null); + + /** If set to true, means this is a permanent deletion (versus an expiration). */ + permanentRemoval?: (boolean|null); + } + + /** Mark a smart contract as deleted, and transfer its remaining hbars to another account. */ + class ContractDeleteTransactionBody implements IContractDeleteTransactionBody { + + /** + * Constructs a new ContractDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractDeleteTransactionBody); + + /** The contract to delete. */ + public contractID?: (proto.IContractID|null); + + /** The account to receive any remaining hbars from the deleted contract. */ + public transferAccountID?: (proto.IAccountID|null); + + /** The contract to receive any remaining hbars from the deleted contract. */ + public transferContractID?: (proto.IContractID|null); + + /** If set to true, means this is a permanent deletion (versus an expiration). */ + public permanentRemoval: boolean; + + /** ContractDeleteTransactionBody obtainers. */ + public obtainers?: ("transferAccountID"|"transferContractID"); + + /** + * Creates a new ContractDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractDeleteTransactionBody instance + */ + public static create(properties?: proto.IContractDeleteTransactionBody): proto.ContractDeleteTransactionBody; + + /** + * Encodes the specified ContractDeleteTransactionBody message. Does not implicitly {@link proto.ContractDeleteTransactionBody.verify|verify} messages. + * @param m ContractDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractDeleteTransactionBody; + + /** + * Gets the default type url for ContractDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/contract_delete_transaction.js b/packages/proto/src/minimal/contract_delete_transaction.js new file mode 100644 index 0000000000..5fd1cc18de --- /dev/null +++ b/packages/proto/src/minimal/contract_delete_transaction.js @@ -0,0 +1,11176 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_contract_delete_transaction || ($protobuf.roots.hashgraph_contract_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for contract deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IContractDeleteTransactionBody|null} [contractDeleteInstance] Delete a smart contract and transfer remaining balance to a specified account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for contract deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a smart contract and transfer remaining balance to a specified account. + * @member {proto.IContractDeleteTransactionBody|null|undefined} contractDeleteInstance + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.contractDeleteInstance = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"contractDeleteInstance"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["contractDeleteInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.contractDeleteInstance != null && Object.hasOwnProperty.call(m, "contractDeleteInstance")) + $root.proto.ContractDeleteTransactionBody.encode(m.contractDeleteInstance, w.uint32(82).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 10: { + m.contractDeleteInstance = $root.proto.ContractDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ContractDeleteTransactionBody = (function() { + + /** + * Properties of a ContractDeleteTransactionBody. + * @memberof proto + * @interface IContractDeleteTransactionBody + * @property {proto.IContractID|null} [contractID] The contract to delete. + * @property {proto.IAccountID|null} [transferAccountID] The account to receive any remaining hbars from the deleted contract. + * @property {proto.IContractID|null} [transferContractID] The contract to receive any remaining hbars from the deleted contract. + * @property {boolean|null} [permanentRemoval] If set to true, means this is a permanent deletion (versus an expiration). + */ + + /** + * Constructs a new ContractDeleteTransactionBody. + * @memberof proto + * @classdesc Mark a smart contract as deleted, and transfer its remaining hbars to another account. + * @implements IContractDeleteTransactionBody + * @constructor + * @param {proto.IContractDeleteTransactionBody=} [p] Properties to set + */ + function ContractDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The contract to delete. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.ContractDeleteTransactionBody + * @instance + */ + ContractDeleteTransactionBody.prototype.contractID = null; + + /** + * The account to receive any remaining hbars from the deleted contract. + * @member {proto.IAccountID|null|undefined} transferAccountID + * @memberof proto.ContractDeleteTransactionBody + * @instance + */ + ContractDeleteTransactionBody.prototype.transferAccountID = null; + + /** + * The contract to receive any remaining hbars from the deleted contract. + * @member {proto.IContractID|null|undefined} transferContractID + * @memberof proto.ContractDeleteTransactionBody + * @instance + */ + ContractDeleteTransactionBody.prototype.transferContractID = null; + + /** + * If set to true, means this is a permanent deletion (versus an expiration). + * @member {boolean} permanentRemoval + * @memberof proto.ContractDeleteTransactionBody + * @instance + */ + ContractDeleteTransactionBody.prototype.permanentRemoval = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractDeleteTransactionBody obtainers. + * @member {"transferAccountID"|"transferContractID"|undefined} obtainers + * @memberof proto.ContractDeleteTransactionBody + * @instance + */ + Object.defineProperty(ContractDeleteTransactionBody.prototype, "obtainers", { + get: $util.oneOfGetter($oneOfFields = ["transferAccountID", "transferContractID"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ContractDeleteTransactionBody + * @static + * @param {proto.IContractDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.ContractDeleteTransactionBody} ContractDeleteTransactionBody instance + */ + ContractDeleteTransactionBody.create = function create(properties) { + return new ContractDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified ContractDeleteTransactionBody message. Does not implicitly {@link proto.ContractDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ContractDeleteTransactionBody + * @static + * @param {proto.IContractDeleteTransactionBody} m ContractDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.transferAccountID != null && Object.hasOwnProperty.call(m, "transferAccountID")) + $root.proto.AccountID.encode(m.transferAccountID, w.uint32(18).fork()).ldelim(); + if (m.transferContractID != null && Object.hasOwnProperty.call(m, "transferContractID")) + $root.proto.ContractID.encode(m.transferContractID, w.uint32(26).fork()).ldelim(); + if (m.permanentRemoval != null && Object.hasOwnProperty.call(m, "permanentRemoval")) + w.uint32(32).bool(m.permanentRemoval); + return w; + }; + + /** + * Decodes a ContractDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractDeleteTransactionBody} ContractDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.transferAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transferContractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 4: { + m.permanentRemoval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.ContractDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractDeleteTransactionBody"; + }; + + return ContractDeleteTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/contract_update_transaction.d.ts b/packages/proto/src/minimal/contract_update_transaction.d.ts new file mode 100644 index 0000000000..f6f7c41561 --- /dev/null +++ b/packages/proto/src/minimal/contract_update_transaction.d.ts @@ -0,0 +1,6456 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_contract_update_transaction; + +declare namespace hashgraph_contract_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for contract updates. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update a smart contract. */ + contractUpdateInstance?: (proto.IContractUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for contract updates. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update a smart contract. */ + public contractUpdateInstance?: (proto.IContractUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "contractUpdateInstance"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractUpdateTransactionBody. */ + interface IContractUpdateTransactionBody { + + /** The Contract ID of the contract to update. */ + contractID?: (proto.IContractID|null); + + /** The expiration time to extend to (the amount to extend the current expiration time). */ + expirationTime?: (proto.ITimestamp|null); + + /** The new admin key for this contract. */ + adminKey?: (proto.IKey|null); + + /** An account that is charged for auto-renewal of this contract. */ + proxyAccountID?: (proto.IAccountID|null); + + /** The auto renew period for this contract. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** The new file ID of the bytecode to update the contract with. */ + fileID?: (proto.IFileID|null); + + /** The new contract memo, assumed to be Unicode encoded with UTF-8. */ + memo?: (string|null); + + /** The maximum number of tokens that this contract can be automatically associated with. */ + maxAutomaticTokenAssociations?: (number|null); + + /** An account to charge for auto-renewal of this contract. */ + autoRenewAccountId?: (proto.IAccountID|null); + + /** ID of the account to which this contract is staking. */ + stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this contract is staked to. */ + stakedNodeId?: (Long|null); + + /** If set to the sentinel value of -1, then this contract declines receiving a staking reward. */ + declineReward?: (boolean|null); + } + + /** Modify a smart contract. */ + class ContractUpdateTransactionBody implements IContractUpdateTransactionBody { + + /** + * Constructs a new ContractUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractUpdateTransactionBody); + + /** The Contract ID of the contract to update. */ + public contractID?: (proto.IContractID|null); + + /** The expiration time to extend to (the amount to extend the current expiration time). */ + public expirationTime?: (proto.ITimestamp|null); + + /** The new admin key for this contract. */ + public adminKey?: (proto.IKey|null); + + /** An account that is charged for auto-renewal of this contract. */ + public proxyAccountID?: (proto.IAccountID|null); + + /** The auto renew period for this contract. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** The new file ID of the bytecode to update the contract with. */ + public fileID?: (proto.IFileID|null); + + /** The new contract memo, assumed to be Unicode encoded with UTF-8. */ + public memo: string; + + /** The maximum number of tokens that this contract can be automatically associated with. */ + public maxAutomaticTokenAssociations: number; + + /** An account to charge for auto-renewal of this contract. */ + public autoRenewAccountId?: (proto.IAccountID|null); + + /** ID of the account to which this contract is staking. */ + public stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this contract is staked to. */ + public stakedNodeId?: (Long|null); + + /** If set to the sentinel value of -1, then this contract declines receiving a staking reward. */ + public declineReward: boolean; + + /** ContractUpdateTransactionBody stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new ContractUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractUpdateTransactionBody instance + */ + public static create(properties?: proto.IContractUpdateTransactionBody): proto.ContractUpdateTransactionBody; + + /** + * Encodes the specified ContractUpdateTransactionBody message. Does not implicitly {@link proto.ContractUpdateTransactionBody.verify|verify} messages. + * @param m ContractUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractUpdateTransactionBody; + + /** + * Gets the default type url for ContractUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/contract_update_transaction.js b/packages/proto/src/minimal/contract_update_transaction.js new file mode 100644 index 0000000000..c98ecbabf0 --- /dev/null +++ b/packages/proto/src/minimal/contract_update_transaction.js @@ -0,0 +1,11296 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_contract_update_transaction || ($protobuf.roots.hashgraph_contract_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for contract updates. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IContractUpdateTransactionBody|null} [contractUpdateInstance] Update a smart contract. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for contract updates. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update a smart contract. + * @member {proto.IContractUpdateTransactionBody|null|undefined} contractUpdateInstance + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.contractUpdateInstance = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"contractUpdateInstance"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["contractUpdateInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.contractUpdateInstance != null && Object.hasOwnProperty.call(m, "contractUpdateInstance")) + $root.proto.ContractUpdateTransactionBody.encode(m.contractUpdateInstance, w.uint32(74).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 9: { + m.contractUpdateInstance = $root.proto.ContractUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ContractUpdateTransactionBody = (function() { + + /** + * Properties of a ContractUpdateTransactionBody. + * @memberof proto + * @interface IContractUpdateTransactionBody + * @property {proto.IContractID|null} [contractID] The Contract ID of the contract to update. + * @property {proto.ITimestamp|null} [expirationTime] The expiration time to extend to (the amount to extend the current expiration time). + * @property {proto.IKey|null} [adminKey] The new admin key for this contract. + * @property {proto.IAccountID|null} [proxyAccountID] An account that is charged for auto-renewal of this contract. + * @property {proto.IDuration|null} [autoRenewPeriod] The auto renew period for this contract. + * @property {proto.IFileID|null} [fileID] The new file ID of the bytecode to update the contract with. + * @property {string|null} [memo] The new contract memo, assumed to be Unicode encoded with UTF-8. + * @property {number|null} [maxAutomaticTokenAssociations] The maximum number of tokens that this contract can be automatically associated with. + * @property {proto.IAccountID|null} [autoRenewAccountId] An account to charge for auto-renewal of this contract. + * @property {proto.IAccountID|null} [stakedAccountId] ID of the account to which this contract is staking. + * @property {Long|null} [stakedNodeId] ID of the node this contract is staked to. + * @property {boolean|null} [declineReward] If set to the sentinel value of -1, then this contract declines receiving a staking reward. + */ + + /** + * Constructs a new ContractUpdateTransactionBody. + * @memberof proto + * @classdesc Modify a smart contract. + * @implements IContractUpdateTransactionBody + * @constructor + * @param {proto.IContractUpdateTransactionBody=} [p] Properties to set + */ + function ContractUpdateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The Contract ID of the contract to update. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.contractID = null; + + /** + * The expiration time to extend to (the amount to extend the current expiration time). + * @member {proto.ITimestamp|null|undefined} expirationTime + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.expirationTime = null; + + /** + * The new admin key for this contract. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.adminKey = null; + + /** + * An account that is charged for auto-renewal of this contract. + * @member {proto.IAccountID|null|undefined} proxyAccountID + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.proxyAccountID = null; + + /** + * The auto renew period for this contract. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * The new file ID of the bytecode to update the contract with. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.fileID = null; + + /** + * The new contract memo, assumed to be Unicode encoded with UTF-8. + * @member {string} memo + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.memo = ""; + + /** + * The maximum number of tokens that this contract can be automatically associated with. + * @member {number} maxAutomaticTokenAssociations + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.maxAutomaticTokenAssociations = 0; + + /** + * An account to charge for auto-renewal of this contract. + * @member {proto.IAccountID|null|undefined} autoRenewAccountId + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.autoRenewAccountId = null; + + /** + * ID of the account to which this contract is staking. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.stakedAccountId = null; + + /** + * ID of the node this contract is staked to. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.stakedNodeId = null; + + /** + * If set to the sentinel value of -1, then this contract declines receiving a staking reward. + * @member {boolean} declineReward + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + ContractUpdateTransactionBody.prototype.declineReward = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractUpdateTransactionBody stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.ContractUpdateTransactionBody + * @instance + */ + Object.defineProperty(ContractUpdateTransactionBody.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ContractUpdateTransactionBody + * @static + * @param {proto.IContractUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.ContractUpdateTransactionBody} ContractUpdateTransactionBody instance + */ + ContractUpdateTransactionBody.create = function create(properties) { + return new ContractUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified ContractUpdateTransactionBody message. Does not implicitly {@link proto.ContractUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ContractUpdateTransactionBody + * @static + * @param {proto.IContractUpdateTransactionBody} m ContractUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.Timestamp.encode(m.expirationTime, w.uint32(18).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(26).fork()).ldelim(); + if (m.proxyAccountID != null && Object.hasOwnProperty.call(m, "proxyAccountID")) + $root.proto.AccountID.encode(m.proxyAccountID, w.uint32(50).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(58).fork()).ldelim(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(66).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(74).string(m.memo); + if (m.maxAutomaticTokenAssociations != null && Object.hasOwnProperty.call(m, "maxAutomaticTokenAssociations")) + w.uint32(80).int32(m.maxAutomaticTokenAssociations); + if (m.autoRenewAccountId != null && Object.hasOwnProperty.call(m, "autoRenewAccountId")) + $root.proto.AccountID.encode(m.autoRenewAccountId, w.uint32(90).fork()).ldelim(); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(98).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(104).int64(m.stakedNodeId); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(112).bool(m.declineReward); + return w; + }; + + /** + * Decodes a ContractUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractUpdateTransactionBody} ContractUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.expirationTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 6: { + m.proxyAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 8: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 9: { + m.memo = r.string(); + break; + } + case 10: { + m.maxAutomaticTokenAssociations = r.int32(); + break; + } + case 11: { + m.autoRenewAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 12: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 13: { + m.stakedNodeId = r.int64(); + break; + } + case 14: { + m.declineReward = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.ContractUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractUpdateTransactionBody"; + }; + + return ContractUpdateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_approve_allowance_transaction.d.ts b/packages/proto/src/minimal/crypto_approve_allowance_transaction.d.ts new file mode 100644 index 0000000000..27103c2293 --- /dev/null +++ b/packages/proto/src/minimal/crypto_approve_allowance_transaction.d.ts @@ -0,0 +1,6615 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_approve_allowance_transaction; + +declare namespace hashgraph_crypto_approve_allowance_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto allowance approval. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Add one or more approved allowances for spenders. */ + cryptoApproveAllowance?: (proto.ICryptoApproveAllowanceTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto allowance approval. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Add one or more approved allowances for spenders. */ + public cryptoApproveAllowance?: (proto.ICryptoApproveAllowanceTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoApproveAllowance"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoApproveAllowanceTransactionBody. */ + interface ICryptoApproveAllowanceTransactionBody { + + /** List of hbar allowances approved by the account owner. */ + cryptoAllowances?: (proto.ICryptoAllowance[]|null); + + /** List of NFT allowances approved by the account owner. */ + nftAllowances?: (proto.INftAllowance[]|null); + + /** List of fungible token allowances approved by the account owner. */ + tokenAllowances?: (proto.ITokenAllowance[]|null); + } + + /** Creates one or more hbar/token approved allowances. */ + class CryptoApproveAllowanceTransactionBody implements ICryptoApproveAllowanceTransactionBody { + + /** + * Constructs a new CryptoApproveAllowanceTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoApproveAllowanceTransactionBody); + + /** List of hbar allowances approved by the account owner. */ + public cryptoAllowances: proto.ICryptoAllowance[]; + + /** List of NFT allowances approved by the account owner. */ + public nftAllowances: proto.INftAllowance[]; + + /** List of fungible token allowances approved by the account owner. */ + public tokenAllowances: proto.ITokenAllowance[]; + + /** + * Creates a new CryptoApproveAllowanceTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoApproveAllowanceTransactionBody instance + */ + public static create(properties?: proto.ICryptoApproveAllowanceTransactionBody): proto.CryptoApproveAllowanceTransactionBody; + + /** + * Encodes the specified CryptoApproveAllowanceTransactionBody message. Does not implicitly {@link proto.CryptoApproveAllowanceTransactionBody.verify|verify} messages. + * @param m CryptoApproveAllowanceTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoApproveAllowanceTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoApproveAllowanceTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoApproveAllowanceTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoApproveAllowanceTransactionBody; + + /** + * Gets the default type url for CryptoApproveAllowanceTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoAllowance. */ + interface ICryptoAllowance { + + /** The account that owns the hbar. */ + owner?: (proto.IAccountID|null); + + /** The account authorized to spend the hbar. */ + spender?: (proto.IAccountID|null); + + /** The amount of hbar authorized to be spent by the spender. */ + amount?: (Long|null); + } + + /** An approved allowance of hbar transfers for a spender. */ + class CryptoAllowance implements ICryptoAllowance { + + /** + * Constructs a new CryptoAllowance. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoAllowance); + + /** The account that owns the hbar. */ + public owner?: (proto.IAccountID|null); + + /** The account authorized to spend the hbar. */ + public spender?: (proto.IAccountID|null); + + /** The amount of hbar authorized to be spent by the spender. */ + public amount: Long; + + /** + * Creates a new CryptoAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoAllowance instance + */ + public static create(properties?: proto.ICryptoAllowance): proto.CryptoAllowance; + + /** + * Encodes the specified CryptoAllowance message. Does not implicitly {@link proto.CryptoAllowance.verify|verify} messages. + * @param m CryptoAllowance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoAllowance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoAllowance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoAllowance; + + /** + * Gets the default type url for CryptoAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftAllowance. */ + interface INftAllowance { + + /** The account that owns the NFT. */ + owner?: (proto.IAccountID|null); + + /** The account authorized to spend the NFT. */ + spender?: (proto.IAccountID|null); + + /** The token that the allowance pertains to. */ + tokenId?: (proto.ITokenID|null); + + /** List of serial numbers that the spender is authorized to transfer. */ + serialNumbers?: (Long[]|null); + + /** If true, the spender has access to all of the owner's NFT units. */ + approvedForAll?: (boolean|null); + + /** The account that should be charged the fee for the current allowance. */ + delegatingSpender?: (proto.IAccountID|null); + } + + /** An approved allowance of NFT transfers for a spender. */ + class NftAllowance implements INftAllowance { + + /** + * Constructs a new NftAllowance. + * @param [p] Properties to set + */ + constructor(p?: proto.INftAllowance); + + /** The account that owns the NFT. */ + public owner?: (proto.IAccountID|null); + + /** The account authorized to spend the NFT. */ + public spender?: (proto.IAccountID|null); + + /** The token that the allowance pertains to. */ + public tokenId?: (proto.ITokenID|null); + + /** List of serial numbers that the spender is authorized to transfer. */ + public serialNumbers: Long[]; + + /** If true, the spender has access to all of the owner's NFT units. */ + public approvedForAll: boolean; + + /** The account that should be charged the fee for the current allowance. */ + public delegatingSpender?: (proto.IAccountID|null); + + /** + * Creates a new NftAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns NftAllowance instance + */ + public static create(properties?: proto.INftAllowance): proto.NftAllowance; + + /** + * Encodes the specified NftAllowance message. Does not implicitly {@link proto.NftAllowance.verify|verify} messages. + * @param m NftAllowance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftAllowance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftAllowance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftAllowance; + + /** + * Gets the default type url for NftAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAllowance. */ + interface ITokenAllowance { + + /** The account that owns the tokens. */ + owner?: (proto.IAccountID|null); + + /** The account authorized to spend the tokens. */ + spender?: (proto.IAccountID|null); + + /** The amount of tokens that the spender is authorized to spend. */ + amount?: (Long|null); + + /** The token that the allowance pertains to. */ + tokenId?: (proto.ITokenID|null); + } + + /** An approved allowance of fungible token transfers for a spender. */ + class TokenAllowance implements ITokenAllowance { + + /** + * Constructs a new TokenAllowance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAllowance); + + /** The account that owns the tokens. */ + public owner?: (proto.IAccountID|null); + + /** The account authorized to spend the tokens. */ + public spender?: (proto.IAccountID|null); + + /** The amount of tokens that the spender is authorized to spend. */ + public amount: Long; + + /** The token that the allowance pertains to. */ + public tokenId?: (proto.ITokenID|null); + + /** + * Creates a new TokenAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAllowance instance + */ + public static create(properties?: proto.ITokenAllowance): proto.TokenAllowance; + + /** + * Encodes the specified TokenAllowance message. Does not implicitly {@link proto.TokenAllowance.verify|verify} messages. + * @param m TokenAllowance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAllowance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAllowance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAllowance; + + /** + * Gets the default type url for TokenAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_approve_allowance_transaction.js b/packages/proto/src/minimal/crypto_approve_allowance_transaction.js new file mode 100644 index 0000000000..ea7cbe2a5d --- /dev/null +++ b/packages/proto/src/minimal/crypto_approve_allowance_transaction.js @@ -0,0 +1,11651 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_approve_allowance_transaction || ($protobuf.roots.hashgraph_crypto_approve_allowance_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto allowance approval. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoApproveAllowanceTransactionBody|null} [cryptoApproveAllowance] Add one or more approved allowances for spenders. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto allowance approval. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Add one or more approved allowances for spenders. + * @member {proto.ICryptoApproveAllowanceTransactionBody|null|undefined} cryptoApproveAllowance + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoApproveAllowance = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoApproveAllowance"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoApproveAllowance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoApproveAllowance != null && Object.hasOwnProperty.call(m, "cryptoApproveAllowance")) + $root.proto.CryptoApproveAllowanceTransactionBody.encode(m.cryptoApproveAllowance, w.uint32(298).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 37: { + m.cryptoApproveAllowance = $root.proto.CryptoApproveAllowanceTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.CryptoApproveAllowanceTransactionBody = (function() { + + /** + * Properties of a CryptoApproveAllowanceTransactionBody. + * @memberof proto + * @interface ICryptoApproveAllowanceTransactionBody + * @property {Array.|null} [cryptoAllowances] List of hbar allowances approved by the account owner. + * @property {Array.|null} [nftAllowances] List of NFT allowances approved by the account owner. + * @property {Array.|null} [tokenAllowances] List of fungible token allowances approved by the account owner. + */ + + /** + * Constructs a new CryptoApproveAllowanceTransactionBody. + * @memberof proto + * @classdesc Creates one or more hbar/token approved allowances. + * @implements ICryptoApproveAllowanceTransactionBody + * @constructor + * @param {proto.ICryptoApproveAllowanceTransactionBody=} [p] Properties to set + */ + function CryptoApproveAllowanceTransactionBody(p) { + this.cryptoAllowances = []; + this.nftAllowances = []; + this.tokenAllowances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * List of hbar allowances approved by the account owner. + * @member {Array.} cryptoAllowances + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @instance + */ + CryptoApproveAllowanceTransactionBody.prototype.cryptoAllowances = $util.emptyArray; + + /** + * List of NFT allowances approved by the account owner. + * @member {Array.} nftAllowances + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @instance + */ + CryptoApproveAllowanceTransactionBody.prototype.nftAllowances = $util.emptyArray; + + /** + * List of fungible token allowances approved by the account owner. + * @member {Array.} tokenAllowances + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @instance + */ + CryptoApproveAllowanceTransactionBody.prototype.tokenAllowances = $util.emptyArray; + + /** + * Creates a new CryptoApproveAllowanceTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @static + * @param {proto.ICryptoApproveAllowanceTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoApproveAllowanceTransactionBody} CryptoApproveAllowanceTransactionBody instance + */ + CryptoApproveAllowanceTransactionBody.create = function create(properties) { + return new CryptoApproveAllowanceTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoApproveAllowanceTransactionBody message. Does not implicitly {@link proto.CryptoApproveAllowanceTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @static + * @param {proto.ICryptoApproveAllowanceTransactionBody} m CryptoApproveAllowanceTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoApproveAllowanceTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.cryptoAllowances != null && m.cryptoAllowances.length) { + for (var i = 0; i < m.cryptoAllowances.length; ++i) + $root.proto.CryptoAllowance.encode(m.cryptoAllowances[i], w.uint32(10).fork()).ldelim(); + } + if (m.nftAllowances != null && m.nftAllowances.length) { + for (var i = 0; i < m.nftAllowances.length; ++i) + $root.proto.NftAllowance.encode(m.nftAllowances[i], w.uint32(18).fork()).ldelim(); + } + if (m.tokenAllowances != null && m.tokenAllowances.length) { + for (var i = 0; i < m.tokenAllowances.length; ++i) + $root.proto.TokenAllowance.encode(m.tokenAllowances[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CryptoApproveAllowanceTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoApproveAllowanceTransactionBody} CryptoApproveAllowanceTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoApproveAllowanceTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoApproveAllowanceTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.cryptoAllowances && m.cryptoAllowances.length)) + m.cryptoAllowances = []; + m.cryptoAllowances.push($root.proto.CryptoAllowance.decode(r, r.uint32())); + break; + } + case 2: { + if (!(m.nftAllowances && m.nftAllowances.length)) + m.nftAllowances = []; + m.nftAllowances.push($root.proto.NftAllowance.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.tokenAllowances && m.tokenAllowances.length)) + m.tokenAllowances = []; + m.tokenAllowances.push($root.proto.TokenAllowance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoApproveAllowanceTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoApproveAllowanceTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoApproveAllowanceTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoApproveAllowanceTransactionBody"; + }; + + return CryptoApproveAllowanceTransactionBody; + })(); + + proto.CryptoAllowance = (function() { + + /** + * Properties of a CryptoAllowance. + * @memberof proto + * @interface ICryptoAllowance + * @property {proto.IAccountID|null} [owner] The account that owns the hbar. + * @property {proto.IAccountID|null} [spender] The account authorized to spend the hbar. + * @property {Long|null} [amount] The amount of hbar authorized to be spent by the spender. + */ + + /** + * Constructs a new CryptoAllowance. + * @memberof proto + * @classdesc An approved allowance of hbar transfers for a spender. + * @implements ICryptoAllowance + * @constructor + * @param {proto.ICryptoAllowance=} [p] Properties to set + */ + function CryptoAllowance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account that owns the hbar. + * @member {proto.IAccountID|null|undefined} owner + * @memberof proto.CryptoAllowance + * @instance + */ + CryptoAllowance.prototype.owner = null; + + /** + * The account authorized to spend the hbar. + * @member {proto.IAccountID|null|undefined} spender + * @memberof proto.CryptoAllowance + * @instance + */ + CryptoAllowance.prototype.spender = null; + + /** + * The amount of hbar authorized to be spent by the spender. + * @member {Long} amount + * @memberof proto.CryptoAllowance + * @instance + */ + CryptoAllowance.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new CryptoAllowance instance using the specified properties. + * @function create + * @memberof proto.CryptoAllowance + * @static + * @param {proto.ICryptoAllowance=} [properties] Properties to set + * @returns {proto.CryptoAllowance} CryptoAllowance instance + */ + CryptoAllowance.create = function create(properties) { + return new CryptoAllowance(properties); + }; + + /** + * Encodes the specified CryptoAllowance message. Does not implicitly {@link proto.CryptoAllowance.verify|verify} messages. + * @function encode + * @memberof proto.CryptoAllowance + * @static + * @param {proto.ICryptoAllowance} m CryptoAllowance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoAllowance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.owner != null && Object.hasOwnProperty.call(m, "owner")) + $root.proto.AccountID.encode(m.owner, w.uint32(10).fork()).ldelim(); + if (m.spender != null && Object.hasOwnProperty.call(m, "spender")) + $root.proto.AccountID.encode(m.spender, w.uint32(18).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(24).int64(m.amount); + return w; + }; + + /** + * Decodes a CryptoAllowance message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoAllowance} CryptoAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoAllowance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoAllowance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.owner = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.spender = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.amount = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoAllowance + * @function getTypeUrl + * @memberof proto.CryptoAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoAllowance"; + }; + + return CryptoAllowance; + })(); + + proto.NftAllowance = (function() { + + /** + * Properties of a NftAllowance. + * @memberof proto + * @interface INftAllowance + * @property {proto.IAccountID|null} [owner] The account that owns the NFT. + * @property {proto.IAccountID|null} [spender] The account authorized to spend the NFT. + * @property {proto.ITokenID|null} [tokenId] The token that the allowance pertains to. + * @property {Array.|null} [serialNumbers] List of serial numbers that the spender is authorized to transfer. + * @property {boolean|null} [approvedForAll] If true, the spender has access to all of the owner's NFT units. + * @property {proto.IAccountID|null} [delegatingSpender] The account that should be charged the fee for the current allowance. + */ + + /** + * Constructs a new NftAllowance. + * @memberof proto + * @classdesc An approved allowance of NFT transfers for a spender. + * @implements INftAllowance + * @constructor + * @param {proto.INftAllowance=} [p] Properties to set + */ + function NftAllowance(p) { + this.serialNumbers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account that owns the NFT. + * @member {proto.IAccountID|null|undefined} owner + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.owner = null; + + /** + * The account authorized to spend the NFT. + * @member {proto.IAccountID|null|undefined} spender + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.spender = null; + + /** + * The token that the allowance pertains to. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.tokenId = null; + + /** + * List of serial numbers that the spender is authorized to transfer. + * @member {Array.} serialNumbers + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.serialNumbers = $util.emptyArray; + + /** + * If true, the spender has access to all of the owner's NFT units. + * @member {boolean} approvedForAll + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.approvedForAll = false; + + /** + * The account that should be charged the fee for the current allowance. + * @member {proto.IAccountID|null|undefined} delegatingSpender + * @memberof proto.NftAllowance + * @instance + */ + NftAllowance.prototype.delegatingSpender = null; + + /** + * Creates a new NftAllowance instance using the specified properties. + * @function create + * @memberof proto.NftAllowance + * @static + * @param {proto.INftAllowance=} [properties] Properties to set + * @returns {proto.NftAllowance} NftAllowance instance + */ + NftAllowance.create = function create(properties) { + return new NftAllowance(properties); + }; + + /** + * Encodes the specified NftAllowance message. Does not implicitly {@link proto.NftAllowance.verify|verify} messages. + * @function encode + * @memberof proto.NftAllowance + * @static + * @param {proto.INftAllowance} m NftAllowance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftAllowance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.owner != null && Object.hasOwnProperty.call(m, "owner")) + $root.proto.AccountID.encode(m.owner, w.uint32(10).fork()).ldelim(); + if (m.spender != null && Object.hasOwnProperty.call(m, "spender")) + $root.proto.AccountID.encode(m.spender, w.uint32(18).fork()).ldelim(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(26).fork()).ldelim(); + if (m.serialNumbers != null && m.serialNumbers.length) { + w.uint32(34).fork(); + for (var i = 0; i < m.serialNumbers.length; ++i) + w.int64(m.serialNumbers[i]); + w.ldelim(); + } + if (m.approvedForAll != null && Object.hasOwnProperty.call(m, "approvedForAll")) + w.uint32(40).bool(m.approvedForAll); + if (m.delegatingSpender != null && Object.hasOwnProperty.call(m, "delegatingSpender")) + $root.proto.AccountID.encode(m.delegatingSpender, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a NftAllowance message from the specified reader or buffer. + * @function decode + * @memberof proto.NftAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftAllowance} NftAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftAllowance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftAllowance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.owner = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.spender = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.serialNumbers && m.serialNumbers.length)) + m.serialNumbers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.serialNumbers.push(r.int64()); + } else + m.serialNumbers.push(r.int64()); + break; + } + case 5: { + m.approvedForAll = r.bool(); + break; + } + case 6: { + m.delegatingSpender = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftAllowance + * @function getTypeUrl + * @memberof proto.NftAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftAllowance"; + }; + + return NftAllowance; + })(); + + proto.TokenAllowance = (function() { + + /** + * Properties of a TokenAllowance. + * @memberof proto + * @interface ITokenAllowance + * @property {proto.IAccountID|null} [owner] The account that owns the tokens. + * @property {proto.IAccountID|null} [spender] The account authorized to spend the tokens. + * @property {Long|null} [amount] The amount of tokens that the spender is authorized to spend. + * @property {proto.ITokenID|null} [tokenId] The token that the allowance pertains to. + */ + + /** + * Constructs a new TokenAllowance. + * @memberof proto + * @classdesc An approved allowance of fungible token transfers for a spender. + * @implements ITokenAllowance + * @constructor + * @param {proto.ITokenAllowance=} [p] Properties to set + */ + function TokenAllowance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account that owns the tokens. + * @member {proto.IAccountID|null|undefined} owner + * @memberof proto.TokenAllowance + * @instance + */ + TokenAllowance.prototype.owner = null; + + /** + * The account authorized to spend the tokens. + * @member {proto.IAccountID|null|undefined} spender + * @memberof proto.TokenAllowance + * @instance + */ + TokenAllowance.prototype.spender = null; + + /** + * The amount of tokens that the spender is authorized to spend. + * @member {Long} amount + * @memberof proto.TokenAllowance + * @instance + */ + TokenAllowance.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token that the allowance pertains to. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAllowance + * @instance + */ + TokenAllowance.prototype.tokenId = null; + + /** + * Creates a new TokenAllowance instance using the specified properties. + * @function create + * @memberof proto.TokenAllowance + * @static + * @param {proto.ITokenAllowance=} [properties] Properties to set + * @returns {proto.TokenAllowance} TokenAllowance instance + */ + TokenAllowance.create = function create(properties) { + return new TokenAllowance(properties); + }; + + /** + * Encodes the specified TokenAllowance message. Does not implicitly {@link proto.TokenAllowance.verify|verify} messages. + * @function encode + * @memberof proto.TokenAllowance + * @static + * @param {proto.ITokenAllowance} m TokenAllowance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAllowance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.owner != null && Object.hasOwnProperty.call(m, "owner")) + $root.proto.AccountID.encode(m.owner, w.uint32(10).fork()).ldelim(); + if (m.spender != null && Object.hasOwnProperty.call(m, "spender")) + $root.proto.AccountID.encode(m.spender, w.uint32(18).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(24).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAllowance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAllowance} TokenAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAllowance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAllowance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.owner = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.spender = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.amount = r.int64(); + break; + } + case 4: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAllowance + * @function getTypeUrl + * @memberof proto.TokenAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAllowance"; + }; + + return TokenAllowance; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_create_transaction.d.ts b/packages/proto/src/minimal/crypto_create_transaction.d.ts new file mode 100644 index 0000000000..67c537ca00 --- /dev/null +++ b/packages/proto/src/minimal/crypto_create_transaction.d.ts @@ -0,0 +1,6766 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_create_transaction; + +declare namespace hashgraph_crypto_create_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** + * Replaced with `signedTransactionBytes`. + * The body of the transaction. + */ + body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body. + */ + sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body with a newer format. + */ + sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`. + * TransactionBody serialized into bytes. + */ + bodyBytes?: (Uint8Array|null); + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto account creation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** + * Replaced with `signedTransactionBytes`. + * The body of the transaction. + */ + public body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body with a newer format. + */ + public sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`. + * TransactionBody serialized into bytes. + */ + public bodyBytes: Uint8Array; + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** + * Records are always generated. + * Obsolete option to not generate a record. + */ + generateRecord?: (boolean|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a new Hedera account. */ + cryptoCreateAccount?: (proto.ICryptoCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto account creation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** + * Records are always generated. + * Obsolete option to not generate a record. + */ + public generateRecord: boolean; + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a new Hedera account. */ + public cryptoCreateAccount?: (proto.ICryptoCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoCreateAccount"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoCreateTransactionBody. */ + interface ICryptoCreateTransactionBody { + + /** + * The identifying key for this account. + * This key represents the account owner, and is required for most actions + * involving this account that do not modify the account itself. This key + * may also identify the account for smart contracts. + *

+ * This field is REQUIRED. + * This `Key` MUST NOT be an empty `KeyList` and MUST contain at least one + * "primitive" (i.e. cryptographic) key value. + */ + key?: (proto.IKey|null); + + /** + * An amount, in tinybar, to deposit to the newly created account. + *

+ * The deposited amount SHALL be debited to the "payer" account for this + * transaction. + */ + initialBalance?: (Long|null); + + /** + * Use `staked_id` instead.
+ * An account identifier for a staking proxy. + */ + proxyAccountID?: (proto.IAccountID|null); + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that reduces this account balance. + */ + sendRecordThreshold?: (Long|null); + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that increases this account balance. + */ + receiveRecordThreshold?: (Long|null); + + /** + * A flag indicating the account holder must authorize all incoming + * token transfers. + *

+ * If this flag is set then any transaction that would result in adding + * hbar or other tokens to this account balance MUST be signed by the + * identifying key of this account (that is, the `key` field).
+ * If this flag is set, then the account key (`key` field) MUST sign + * this create transaction, in addition to the transaction payer. + */ + receiverSigRequired?: (boolean|null); + + /** + * The duration between account automatic renewals.
+ * All entities in state may be charged "rent" occasionally (typically + * every 90 days) to prevent unnecessary growth of the ledger. This value + * sets the interval between such events for this account. + *

+ * If the account balance (in HBAR) is insufficient to pay the full renewal + * fee, the entire HBAR balance SHALL be consumed and the expiration for + * the account SHALL be extended as far as the available balance can + * support.
+ * If the account HBAR balance is `0` when the account must be renewed, then + * the account SHALL be deleted, and subsequently removed from state. + */ + autoRenewPeriod?: (proto.IDuration|null); + + /** + * The shard in which this account is created + *

+ * Currently, this MUST be `0`.
+ * If the desired shard is `0`, this SHOULD NOT be set. + */ + shardID?: (proto.IShardID|null); + + /** + * The realm in which this account is created. + *

+ * The shard number for this realm MUST match the value in `shardID`.
+ * Currently, this MUST be `0` for both fields.
+ * If the desired realm is `0`, this SHOULD NOT be set. + */ + realmID?: (proto.IRealmID|null); + + /** + * This field was never actually used or enabled, and is not expected to + * ever be used in the future.
+ */ + newRealmAdminKey?: (proto.IKey|null); + + /** + * A short description of this Account. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + memo?: (string|null); + + /** + * A maximum number of tokens that can be auto-associated + * with this account.
+ * By default this value is 0 for all accounts except for automatically + * created accounts (e.g. smart contracts), which default to -1. + *

+ * If this value is `0`, then this account MUST manually associate to + * a token before holding or transacting in that token.
+ * This value MAY also be `-1` to indicate no limit.
+ * This value MUST NOT be less than `-1`. + */ + maxAutomaticTokenAssociations?: (number|null); + + /** + * ID of the account to which this account is staking its balances. + *

+ * If this account is not currently staking its balances, then this + * field, if set, MUST be the sentinel value of `0.0.0`. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * ID of the node this account is staked to. + *

+ * If this account is not currently staking its balances, then this + * field, if set, SHALL be the sentinel value of `-1`.
+ * Wallet software SHOULD surface staking issues to users and provide a + * simple mechanism to update staking to a new node ID in the event the + * prior staked node ID ceases to be valid. + */ + stakedNodeId?: (Long|null); + + /** + * A boolean indicating that this account has chosen to decline rewards for + * staking its balances. + *

+ * This account MAY still stake its balances, but SHALL NOT receive reward + * payments for doing so, if this value is set. + */ + declineReward?: (boolean|null); + + /** + * Bytes to be used as the account's alias. + *

+ * This value, if set, MUST be one of the following values
+ *

    + *
  • The 32-byte serialized form of the ED25519 account key.
  • + *
  • The 33-byte _compressed_ serialized form of the ECDSA(secp256k1) + * account key.
  • + *
  • The 20-byte EVM address derived from a keccak-256 hash of the + * ECDSA(secp256k1) account key
  • + *
+ * All aliases within the network MUST be unique. If this value matches an + * existing account alias, this `create` transaction SHALL fail.
+ * If an account exists with a particular alias value, any transaction to + * transfer value _to_ that alias SHALL deposit the transferred value in + * the existing account, and SHALL NOT assess an account creation fee.
+ * Once set, an account alias is immutable and MUST NOT be changed. + */ + alias?: (Uint8Array|null); + } + + /** Represents a CryptoCreateTransactionBody. */ + class CryptoCreateTransactionBody implements ICryptoCreateTransactionBody { + + /** + * Constructs a new CryptoCreateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoCreateTransactionBody); + + /** + * The identifying key for this account. + * This key represents the account owner, and is required for most actions + * involving this account that do not modify the account itself. This key + * may also identify the account for smart contracts. + *

+ * This field is REQUIRED. + * This `Key` MUST NOT be an empty `KeyList` and MUST contain at least one + * "primitive" (i.e. cryptographic) key value. + */ + public key?: (proto.IKey|null); + + /** + * An amount, in tinybar, to deposit to the newly created account. + *

+ * The deposited amount SHALL be debited to the "payer" account for this + * transaction. + */ + public initialBalance: Long; + + /** + * Use `staked_id` instead.
+ * An account identifier for a staking proxy. + */ + public proxyAccountID?: (proto.IAccountID|null); + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that reduces this account balance. + */ + public sendRecordThreshold: Long; + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that increases this account balance. + */ + public receiveRecordThreshold: Long; + + /** + * A flag indicating the account holder must authorize all incoming + * token transfers. + *

+ * If this flag is set then any transaction that would result in adding + * hbar or other tokens to this account balance MUST be signed by the + * identifying key of this account (that is, the `key` field).
+ * If this flag is set, then the account key (`key` field) MUST sign + * this create transaction, in addition to the transaction payer. + */ + public receiverSigRequired: boolean; + + /** + * The duration between account automatic renewals.
+ * All entities in state may be charged "rent" occasionally (typically + * every 90 days) to prevent unnecessary growth of the ledger. This value + * sets the interval between such events for this account. + *

+ * If the account balance (in HBAR) is insufficient to pay the full renewal + * fee, the entire HBAR balance SHALL be consumed and the expiration for + * the account SHALL be extended as far as the available balance can + * support.
+ * If the account HBAR balance is `0` when the account must be renewed, then + * the account SHALL be deleted, and subsequently removed from state. + */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** + * The shard in which this account is created + *

+ * Currently, this MUST be `0`.
+ * If the desired shard is `0`, this SHOULD NOT be set. + */ + public shardID?: (proto.IShardID|null); + + /** + * The realm in which this account is created. + *

+ * The shard number for this realm MUST match the value in `shardID`.
+ * Currently, this MUST be `0` for both fields.
+ * If the desired realm is `0`, this SHOULD NOT be set. + */ + public realmID?: (proto.IRealmID|null); + + /** + * This field was never actually used or enabled, and is not expected to + * ever be used in the future.
+ */ + public newRealmAdminKey?: (proto.IKey|null); + + /** + * A short description of this Account. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public memo: string; + + /** + * A maximum number of tokens that can be auto-associated + * with this account.
+ * By default this value is 0 for all accounts except for automatically + * created accounts (e.g. smart contracts), which default to -1. + *

+ * If this value is `0`, then this account MUST manually associate to + * a token before holding or transacting in that token.
+ * This value MAY also be `-1` to indicate no limit.
+ * This value MUST NOT be less than `-1`. + */ + public maxAutomaticTokenAssociations: number; + + /** + * ID of the account to which this account is staking its balances. + *

+ * If this account is not currently staking its balances, then this + * field, if set, MUST be the sentinel value of `0.0.0`. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * ID of the node this account is staked to. + *

+ * If this account is not currently staking its balances, then this + * field, if set, SHALL be the sentinel value of `-1`.
+ * Wallet software SHOULD surface staking issues to users and provide a + * simple mechanism to update staking to a new node ID in the event the + * prior staked node ID ceases to be valid. + */ + public stakedNodeId?: (Long|null); + + /** + * A boolean indicating that this account has chosen to decline rewards for + * staking its balances. + *

+ * This account MAY still stake its balances, but SHALL NOT receive reward + * payments for doing so, if this value is set. + */ + public declineReward: boolean; + + /** + * Bytes to be used as the account's alias. + *

+ * This value, if set, MUST be one of the following values
+ *

    + *
  • The 32-byte serialized form of the ED25519 account key.
  • + *
  • The 33-byte _compressed_ serialized form of the ECDSA(secp256k1) + * account key.
  • + *
  • The 20-byte EVM address derived from a keccak-256 hash of the + * ECDSA(secp256k1) account key
  • + *
+ * All aliases within the network MUST be unique. If this value matches an + * existing account alias, this `create` transaction SHALL fail.
+ * If an account exists with a particular alias value, any transaction to + * transfer value _to_ that alias SHALL deposit the transferred value in + * the existing account, and SHALL NOT assess an account creation fee.
+ * Once set, an account alias is immutable and MUST NOT be changed. + */ + public alias: Uint8Array; + + /** CryptoCreateTransactionBody stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new CryptoCreateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoCreateTransactionBody instance + */ + public static create(properties?: proto.ICryptoCreateTransactionBody): proto.CryptoCreateTransactionBody; + + /** + * Encodes the specified CryptoCreateTransactionBody message. Does not implicitly {@link proto.CryptoCreateTransactionBody.verify|verify} messages. + * @param m CryptoCreateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoCreateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoCreateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoCreateTransactionBody; + + /** + * Gets the default type url for CryptoCreateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_create_transaction.js b/packages/proto/src/minimal/crypto_create_transaction.js new file mode 100644 index 0000000000..d1cc4d4f49 --- /dev/null +++ b/packages/proto/src/minimal/crypto_create_transaction.js @@ -0,0 +1,11603 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_create_transaction || ($protobuf.roots.hashgraph_crypto_create_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {proto.ITransactionBody|null} [body] Replaced with `signedTransactionBytes`. + * The body of the transaction. + * @property {proto.ISignatureList|null} [sigs] Replaced with `signedTransactionBytes`. + * The signatures on the body. + * @property {proto.ISignatureMap|null} [sigMap] Replaced with `signedTransactionBytes`. + * The signatures on the body with a newer format. + * @property {Uint8Array|null} [bodyBytes] Replaced with `signedTransactionBytes`. + * TransactionBody serialized into bytes. + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto account creation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Replaced with `signedTransactionBytes`. + * The body of the transaction. + * @member {proto.ITransactionBody|null|undefined} body + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.body = null; + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.sigs = null; + + /** + * Replaced with `signedTransactionBytes`. + * The signatures on the body with a newer format. + * @member {proto.ISignatureMap|null|undefined} sigMap + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.sigMap = null; + + /** + * Replaced with `signedTransactionBytes`. + * TransactionBody serialized into bytes. + * @member {Uint8Array} bodyBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.bodyBytes = $util.newBuffer([]); + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.body != null && Object.hasOwnProperty.call(m, "body")) + $root.proto.TransactionBody.encode(m.body, w.uint32(10).fork()).ldelim(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + if (m.sigMap != null && Object.hasOwnProperty.call(m, "sigMap")) + $root.proto.SignatureMap.encode(m.sigMap, w.uint32(26).fork()).ldelim(); + if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) + w.uint32(34).bytes(m.bodyBytes); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.body = $root.proto.TransactionBody.decode(r, r.uint32()); + break; + } + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + case 3: { + m.sigMap = $root.proto.SignatureMap.decode(r, r.uint32()); + break; + } + case 4: { + m.bodyBytes = r.bytes(); + break; + } + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {boolean|null} [generateRecord] Records are always generated. + * Obsolete option to not generate a record. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoCreateTransactionBody|null} [cryptoCreateAccount] Create a new Hedera account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto account creation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * Records are always generated. + * Obsolete option to not generate a record. + * @member {boolean} generateRecord + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.generateRecord = false; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a new Hedera account. + * @member {proto.ICryptoCreateTransactionBody|null|undefined} cryptoCreateAccount + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoCreateAccount = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoCreateAccount"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoCreateAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.generateRecord != null && Object.hasOwnProperty.call(m, "generateRecord")) + w.uint32(40).bool(m.generateRecord); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoCreateAccount != null && Object.hasOwnProperty.call(m, "cryptoCreateAccount")) + $root.proto.CryptoCreateTransactionBody.encode(m.cryptoCreateAccount, w.uint32(90).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 5: { + m.generateRecord = r.bool(); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 11: { + m.cryptoCreateAccount = $root.proto.CryptoCreateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.CryptoCreateTransactionBody = (function() { + + /** + * Properties of a CryptoCreateTransactionBody. + * @memberof proto + * @interface ICryptoCreateTransactionBody + * @property {proto.IKey|null} [key] The identifying key for this account. + * This key represents the account owner, and is required for most actions + * involving this account that do not modify the account itself. This key + * may also identify the account for smart contracts. + *

+ * This field is REQUIRED. + * This `Key` MUST NOT be an empty `KeyList` and MUST contain at least one + * "primitive" (i.e. cryptographic) key value. + * @property {Long|null} [initialBalance] An amount, in tinybar, to deposit to the newly created account. + *

+ * The deposited amount SHALL be debited to the "payer" account for this + * transaction. + * @property {proto.IAccountID|null} [proxyAccountID] Use `staked_id` instead.
+ * An account identifier for a staking proxy. + * @property {Long|null} [sendRecordThreshold] Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that reduces this account balance. + * @property {Long|null} [receiveRecordThreshold] Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that increases this account balance. + * @property {boolean|null} [receiverSigRequired] A flag indicating the account holder must authorize all incoming + * token transfers. + *

+ * If this flag is set then any transaction that would result in adding + * hbar or other tokens to this account balance MUST be signed by the + * identifying key of this account (that is, the `key` field).
+ * If this flag is set, then the account key (`key` field) MUST sign + * this create transaction, in addition to the transaction payer. + * @property {proto.IDuration|null} [autoRenewPeriod] The duration between account automatic renewals.
+ * All entities in state may be charged "rent" occasionally (typically + * every 90 days) to prevent unnecessary growth of the ledger. This value + * sets the interval between such events for this account. + *

+ * If the account balance (in HBAR) is insufficient to pay the full renewal + * fee, the entire HBAR balance SHALL be consumed and the expiration for + * the account SHALL be extended as far as the available balance can + * support.
+ * If the account HBAR balance is `0` when the account must be renewed, then + * the account SHALL be deleted, and subsequently removed from state. + * @property {proto.IShardID|null} [shardID] The shard in which this account is created + *

+ * Currently, this MUST be `0`.
+ * If the desired shard is `0`, this SHOULD NOT be set. + * @property {proto.IRealmID|null} [realmID] The realm in which this account is created. + *

+ * The shard number for this realm MUST match the value in `shardID`.
+ * Currently, this MUST be `0` for both fields.
+ * If the desired realm is `0`, this SHOULD NOT be set. + * @property {proto.IKey|null} [newRealmAdminKey] This field was never actually used or enabled, and is not expected to + * ever be used in the future.
+ * @property {string|null} [memo] A short description of this Account. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {number|null} [maxAutomaticTokenAssociations] A maximum number of tokens that can be auto-associated + * with this account.
+ * By default this value is 0 for all accounts except for automatically + * created accounts (e.g. smart contracts), which default to -1. + *

+ * If this value is `0`, then this account MUST manually associate to + * a token before holding or transacting in that token.
+ * This value MAY also be `-1` to indicate no limit.
+ * This value MUST NOT be less than `-1`. + * @property {proto.IAccountID|null} [stakedAccountId] ID of the account to which this account is staking its balances. + *

+ * If this account is not currently staking its balances, then this + * field, if set, MUST be the sentinel value of `0.0.0`. + * @property {Long|null} [stakedNodeId] ID of the node this account is staked to. + *

+ * If this account is not currently staking its balances, then this + * field, if set, SHALL be the sentinel value of `-1`.
+ * Wallet software SHOULD surface staking issues to users and provide a + * simple mechanism to update staking to a new node ID in the event the + * prior staked node ID ceases to be valid. + * @property {boolean|null} [declineReward] A boolean indicating that this account has chosen to decline rewards for + * staking its balances. + *

+ * This account MAY still stake its balances, but SHALL NOT receive reward + * payments for doing so, if this value is set. + * @property {Uint8Array|null} [alias] Bytes to be used as the account's alias. + *

+ * This value, if set, MUST be one of the following values
+ *

    + *
  • The 32-byte serialized form of the ED25519 account key.
  • + *
  • The 33-byte _compressed_ serialized form of the ECDSA(secp256k1) + * account key.
  • + *
  • The 20-byte EVM address derived from a keccak-256 hash of the + * ECDSA(secp256k1) account key
  • + *
+ * All aliases within the network MUST be unique. If this value matches an + * existing account alias, this `create` transaction SHALL fail.
+ * If an account exists with a particular alias value, any transaction to + * transfer value _to_ that alias SHALL deposit the transferred value in + * the existing account, and SHALL NOT assess an account creation fee.
+ * Once set, an account alias is immutable and MUST NOT be changed. + */ + + /** + * Constructs a new CryptoCreateTransactionBody. + * @memberof proto + * @classdesc Represents a CryptoCreateTransactionBody. + * @implements ICryptoCreateTransactionBody + * @constructor + * @param {proto.ICryptoCreateTransactionBody=} [p] Properties to set + */ + function CryptoCreateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The identifying key for this account. + * This key represents the account owner, and is required for most actions + * involving this account that do not modify the account itself. This key + * may also identify the account for smart contracts. + *

+ * This field is REQUIRED. + * This `Key` MUST NOT be an empty `KeyList` and MUST contain at least one + * "primitive" (i.e. cryptographic) key value. + * @member {proto.IKey|null|undefined} key + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.key = null; + + /** + * An amount, in tinybar, to deposit to the newly created account. + *

+ * The deposited amount SHALL be debited to the "payer" account for this + * transaction. + * @member {Long} initialBalance + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.initialBalance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Use `staked_id` instead.
+ * An account identifier for a staking proxy. + * @member {proto.IAccountID|null|undefined} proxyAccountID + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.proxyAccountID = null; + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that reduces this account balance. + * @member {Long} sendRecordThreshold + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.sendRecordThreshold = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Removed prior to the first available history, and may be related to an + * early design dead-end.
+ * An amount below which record stream records would not be created for + * a transaction that increases this account balance. + * @member {Long} receiveRecordThreshold + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.receiveRecordThreshold = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A flag indicating the account holder must authorize all incoming + * token transfers. + *

+ * If this flag is set then any transaction that would result in adding + * hbar or other tokens to this account balance MUST be signed by the + * identifying key of this account (that is, the `key` field).
+ * If this flag is set, then the account key (`key` field) MUST sign + * this create transaction, in addition to the transaction payer. + * @member {boolean} receiverSigRequired + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.receiverSigRequired = false; + + /** + * The duration between account automatic renewals.
+ * All entities in state may be charged "rent" occasionally (typically + * every 90 days) to prevent unnecessary growth of the ledger. This value + * sets the interval between such events for this account. + *

+ * If the account balance (in HBAR) is insufficient to pay the full renewal + * fee, the entire HBAR balance SHALL be consumed and the expiration for + * the account SHALL be extended as far as the available balance can + * support.
+ * If the account HBAR balance is `0` when the account must be renewed, then + * the account SHALL be deleted, and subsequently removed from state. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * The shard in which this account is created + *

+ * Currently, this MUST be `0`.
+ * If the desired shard is `0`, this SHOULD NOT be set. + * @member {proto.IShardID|null|undefined} shardID + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.shardID = null; + + /** + * The realm in which this account is created. + *

+ * The shard number for this realm MUST match the value in `shardID`.
+ * Currently, this MUST be `0` for both fields.
+ * If the desired realm is `0`, this SHOULD NOT be set. + * @member {proto.IRealmID|null|undefined} realmID + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.realmID = null; + + /** + * This field was never actually used or enabled, and is not expected to + * ever be used in the future.
+ * @member {proto.IKey|null|undefined} newRealmAdminKey + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.newRealmAdminKey = null; + + /** + * A short description of this Account. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} memo + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.memo = ""; + + /** + * A maximum number of tokens that can be auto-associated + * with this account.
+ * By default this value is 0 for all accounts except for automatically + * created accounts (e.g. smart contracts), which default to -1. + *

+ * If this value is `0`, then this account MUST manually associate to + * a token before holding or transacting in that token.
+ * This value MAY also be `-1` to indicate no limit.
+ * This value MUST NOT be less than `-1`. + * @member {number} maxAutomaticTokenAssociations + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.maxAutomaticTokenAssociations = 0; + + /** + * ID of the account to which this account is staking its balances. + *

+ * If this account is not currently staking its balances, then this + * field, if set, MUST be the sentinel value of `0.0.0`. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.stakedAccountId = null; + + /** + * ID of the node this account is staked to. + *

+ * If this account is not currently staking its balances, then this + * field, if set, SHALL be the sentinel value of `-1`.
+ * Wallet software SHOULD surface staking issues to users and provide a + * simple mechanism to update staking to a new node ID in the event the + * prior staked node ID ceases to be valid. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.stakedNodeId = null; + + /** + * A boolean indicating that this account has chosen to decline rewards for + * staking its balances. + *

+ * This account MAY still stake its balances, but SHALL NOT receive reward + * payments for doing so, if this value is set. + * @member {boolean} declineReward + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.declineReward = false; + + /** + * Bytes to be used as the account's alias. + *

+ * This value, if set, MUST be one of the following values
+ *

    + *
  • The 32-byte serialized form of the ED25519 account key.
  • + *
  • The 33-byte _compressed_ serialized form of the ECDSA(secp256k1) + * account key.
  • + *
  • The 20-byte EVM address derived from a keccak-256 hash of the + * ECDSA(secp256k1) account key
  • + *
+ * All aliases within the network MUST be unique. If this value matches an + * existing account alias, this `create` transaction SHALL fail.
+ * If an account exists with a particular alias value, any transaction to + * transfer value _to_ that alias SHALL deposit the transferred value in + * the existing account, and SHALL NOT assess an account creation fee.
+ * Once set, an account alias is immutable and MUST NOT be changed. + * @member {Uint8Array} alias + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + CryptoCreateTransactionBody.prototype.alias = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CryptoCreateTransactionBody stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.CryptoCreateTransactionBody + * @instance + */ + Object.defineProperty(CryptoCreateTransactionBody.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CryptoCreateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoCreateTransactionBody + * @static + * @param {proto.ICryptoCreateTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoCreateTransactionBody} CryptoCreateTransactionBody instance + */ + CryptoCreateTransactionBody.create = function create(properties) { + return new CryptoCreateTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoCreateTransactionBody message. Does not implicitly {@link proto.CryptoCreateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoCreateTransactionBody + * @static + * @param {proto.ICryptoCreateTransactionBody} m CryptoCreateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoCreateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.key != null && Object.hasOwnProperty.call(m, "key")) + $root.proto.Key.encode(m.key, w.uint32(10).fork()).ldelim(); + if (m.initialBalance != null && Object.hasOwnProperty.call(m, "initialBalance")) + w.uint32(16).uint64(m.initialBalance); + if (m.proxyAccountID != null && Object.hasOwnProperty.call(m, "proxyAccountID")) + $root.proto.AccountID.encode(m.proxyAccountID, w.uint32(26).fork()).ldelim(); + if (m.sendRecordThreshold != null && Object.hasOwnProperty.call(m, "sendRecordThreshold")) + w.uint32(48).uint64(m.sendRecordThreshold); + if (m.receiveRecordThreshold != null && Object.hasOwnProperty.call(m, "receiveRecordThreshold")) + w.uint32(56).uint64(m.receiveRecordThreshold); + if (m.receiverSigRequired != null && Object.hasOwnProperty.call(m, "receiverSigRequired")) + w.uint32(64).bool(m.receiverSigRequired); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(74).fork()).ldelim(); + if (m.shardID != null && Object.hasOwnProperty.call(m, "shardID")) + $root.proto.ShardID.encode(m.shardID, w.uint32(82).fork()).ldelim(); + if (m.realmID != null && Object.hasOwnProperty.call(m, "realmID")) + $root.proto.RealmID.encode(m.realmID, w.uint32(90).fork()).ldelim(); + if (m.newRealmAdminKey != null && Object.hasOwnProperty.call(m, "newRealmAdminKey")) + $root.proto.Key.encode(m.newRealmAdminKey, w.uint32(98).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(106).string(m.memo); + if (m.maxAutomaticTokenAssociations != null && Object.hasOwnProperty.call(m, "maxAutomaticTokenAssociations")) + w.uint32(112).int32(m.maxAutomaticTokenAssociations); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(122).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(128).int64(m.stakedNodeId); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(136).bool(m.declineReward); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(146).bytes(m.alias); + return w; + }; + + /** + * Decodes a CryptoCreateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoCreateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoCreateTransactionBody} CryptoCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoCreateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoCreateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.key = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 2: { + m.initialBalance = r.uint64(); + break; + } + case 3: { + m.proxyAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.sendRecordThreshold = r.uint64(); + break; + } + case 7: { + m.receiveRecordThreshold = r.uint64(); + break; + } + case 8: { + m.receiverSigRequired = r.bool(); + break; + } + case 9: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 10: { + m.shardID = $root.proto.ShardID.decode(r, r.uint32()); + break; + } + case 11: { + m.realmID = $root.proto.RealmID.decode(r, r.uint32()); + break; + } + case 12: { + m.newRealmAdminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 13: { + m.memo = r.string(); + break; + } + case 14: { + m.maxAutomaticTokenAssociations = r.int32(); + break; + } + case 15: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 16: { + m.stakedNodeId = r.int64(); + break; + } + case 17: { + m.declineReward = r.bool(); + break; + } + case 18: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoCreateTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoCreateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoCreateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoCreateTransactionBody"; + }; + + return CryptoCreateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_delete_allowance_transaction.d.ts b/packages/proto/src/minimal/crypto_delete_allowance_transaction.d.ts new file mode 100644 index 0000000000..ab73acbb93 --- /dev/null +++ b/packages/proto/src/minimal/crypto_delete_allowance_transaction.d.ts @@ -0,0 +1,6451 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_delete_allowance_transaction; + +declare namespace hashgraph_crypto_delete_allowance_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto allowance deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete one or more approvals for spenders. */ + cryptoDeleteAllowance?: (proto.ICryptoDeleteAllowanceTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto allowance deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete one or more approvals for spenders. */ + public cryptoDeleteAllowance?: (proto.ICryptoDeleteAllowanceTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoDeleteAllowance"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoDeleteAllowanceTransactionBody. */ + interface ICryptoDeleteAllowanceTransactionBody { + + /** List of NFT allowances to be deleted. */ + nftAllowances?: (proto.INftRemoveAllowance[]|null); + } + + /** Deletes one or more non-fungible approved allowances from an owner's account. */ + class CryptoDeleteAllowanceTransactionBody implements ICryptoDeleteAllowanceTransactionBody { + + /** + * Constructs a new CryptoDeleteAllowanceTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoDeleteAllowanceTransactionBody); + + /** List of NFT allowances to be deleted. */ + public nftAllowances: proto.INftRemoveAllowance[]; + + /** + * Creates a new CryptoDeleteAllowanceTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoDeleteAllowanceTransactionBody instance + */ + public static create(properties?: proto.ICryptoDeleteAllowanceTransactionBody): proto.CryptoDeleteAllowanceTransactionBody; + + /** + * Encodes the specified CryptoDeleteAllowanceTransactionBody message. Does not implicitly {@link proto.CryptoDeleteAllowanceTransactionBody.verify|verify} messages. + * @param m CryptoDeleteAllowanceTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoDeleteAllowanceTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoDeleteAllowanceTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoDeleteAllowanceTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoDeleteAllowanceTransactionBody; + + /** + * Gets the default type url for CryptoDeleteAllowanceTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftRemoveAllowance. */ + interface INftRemoveAllowance { + + /** The token that the allowance pertains to. */ + tokenId?: (proto.ITokenID|null); + + /** The account that owns the NFT. */ + owner?: (proto.IAccountID|null); + + /** List of serial numbers to remove allowances from. */ + serialNumbers?: (Long[]|null); + } + + /** Nft allowance to be removed on an owner account. */ + class NftRemoveAllowance implements INftRemoveAllowance { + + /** + * Constructs a new NftRemoveAllowance. + * @param [p] Properties to set + */ + constructor(p?: proto.INftRemoveAllowance); + + /** The token that the allowance pertains to. */ + public tokenId?: (proto.ITokenID|null); + + /** The account that owns the NFT. */ + public owner?: (proto.IAccountID|null); + + /** List of serial numbers to remove allowances from. */ + public serialNumbers: Long[]; + + /** + * Creates a new NftRemoveAllowance instance using the specified properties. + * @param [properties] Properties to set + * @returns NftRemoveAllowance instance + */ + public static create(properties?: proto.INftRemoveAllowance): proto.NftRemoveAllowance; + + /** + * Encodes the specified NftRemoveAllowance message. Does not implicitly {@link proto.NftRemoveAllowance.verify|verify} messages. + * @param m NftRemoveAllowance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftRemoveAllowance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftRemoveAllowance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftRemoveAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftRemoveAllowance; + + /** + * Gets the default type url for NftRemoveAllowance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_delete_allowance_transaction.js b/packages/proto/src/minimal/crypto_delete_allowance_transaction.js new file mode 100644 index 0000000000..1bcc45d8ea --- /dev/null +++ b/packages/proto/src/minimal/crypto_delete_allowance_transaction.js @@ -0,0 +1,11273 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_delete_allowance_transaction || ($protobuf.roots.hashgraph_crypto_delete_allowance_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto allowance deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoDeleteAllowanceTransactionBody|null} [cryptoDeleteAllowance] Delete one or more approvals for spenders. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto allowance deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete one or more approvals for spenders. + * @member {proto.ICryptoDeleteAllowanceTransactionBody|null|undefined} cryptoDeleteAllowance + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoDeleteAllowance = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoDeleteAllowance"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoDeleteAllowance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoDeleteAllowance != null && Object.hasOwnProperty.call(m, "cryptoDeleteAllowance")) + $root.proto.CryptoDeleteAllowanceTransactionBody.encode(m.cryptoDeleteAllowance, w.uint32(306).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 38: { + m.cryptoDeleteAllowance = $root.proto.CryptoDeleteAllowanceTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.CryptoDeleteAllowanceTransactionBody = (function() { + + /** + * Properties of a CryptoDeleteAllowanceTransactionBody. + * @memberof proto + * @interface ICryptoDeleteAllowanceTransactionBody + * @property {Array.|null} [nftAllowances] List of NFT allowances to be deleted. + */ + + /** + * Constructs a new CryptoDeleteAllowanceTransactionBody. + * @memberof proto + * @classdesc Deletes one or more non-fungible approved allowances from an owner's account. + * @implements ICryptoDeleteAllowanceTransactionBody + * @constructor + * @param {proto.ICryptoDeleteAllowanceTransactionBody=} [p] Properties to set + */ + function CryptoDeleteAllowanceTransactionBody(p) { + this.nftAllowances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * List of NFT allowances to be deleted. + * @member {Array.} nftAllowances + * @memberof proto.CryptoDeleteAllowanceTransactionBody + * @instance + */ + CryptoDeleteAllowanceTransactionBody.prototype.nftAllowances = $util.emptyArray; + + /** + * Creates a new CryptoDeleteAllowanceTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoDeleteAllowanceTransactionBody + * @static + * @param {proto.ICryptoDeleteAllowanceTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoDeleteAllowanceTransactionBody} CryptoDeleteAllowanceTransactionBody instance + */ + CryptoDeleteAllowanceTransactionBody.create = function create(properties) { + return new CryptoDeleteAllowanceTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoDeleteAllowanceTransactionBody message. Does not implicitly {@link proto.CryptoDeleteAllowanceTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoDeleteAllowanceTransactionBody + * @static + * @param {proto.ICryptoDeleteAllowanceTransactionBody} m CryptoDeleteAllowanceTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoDeleteAllowanceTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nftAllowances != null && m.nftAllowances.length) { + for (var i = 0; i < m.nftAllowances.length; ++i) + $root.proto.NftRemoveAllowance.encode(m.nftAllowances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CryptoDeleteAllowanceTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoDeleteAllowanceTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoDeleteAllowanceTransactionBody} CryptoDeleteAllowanceTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoDeleteAllowanceTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoDeleteAllowanceTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nftAllowances && m.nftAllowances.length)) + m.nftAllowances = []; + m.nftAllowances.push($root.proto.NftRemoveAllowance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoDeleteAllowanceTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoDeleteAllowanceTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoDeleteAllowanceTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoDeleteAllowanceTransactionBody"; + }; + + return CryptoDeleteAllowanceTransactionBody; + })(); + + proto.NftRemoveAllowance = (function() { + + /** + * Properties of a NftRemoveAllowance. + * @memberof proto + * @interface INftRemoveAllowance + * @property {proto.ITokenID|null} [tokenId] The token that the allowance pertains to. + * @property {proto.IAccountID|null} [owner] The account that owns the NFT. + * @property {Array.|null} [serialNumbers] List of serial numbers to remove allowances from. + */ + + /** + * Constructs a new NftRemoveAllowance. + * @memberof proto + * @classdesc Nft allowance to be removed on an owner account. + * @implements INftRemoveAllowance + * @constructor + * @param {proto.INftRemoveAllowance=} [p] Properties to set + */ + function NftRemoveAllowance(p) { + this.serialNumbers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token that the allowance pertains to. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.NftRemoveAllowance + * @instance + */ + NftRemoveAllowance.prototype.tokenId = null; + + /** + * The account that owns the NFT. + * @member {proto.IAccountID|null|undefined} owner + * @memberof proto.NftRemoveAllowance + * @instance + */ + NftRemoveAllowance.prototype.owner = null; + + /** + * List of serial numbers to remove allowances from. + * @member {Array.} serialNumbers + * @memberof proto.NftRemoveAllowance + * @instance + */ + NftRemoveAllowance.prototype.serialNumbers = $util.emptyArray; + + /** + * Creates a new NftRemoveAllowance instance using the specified properties. + * @function create + * @memberof proto.NftRemoveAllowance + * @static + * @param {proto.INftRemoveAllowance=} [properties] Properties to set + * @returns {proto.NftRemoveAllowance} NftRemoveAllowance instance + */ + NftRemoveAllowance.create = function create(properties) { + return new NftRemoveAllowance(properties); + }; + + /** + * Encodes the specified NftRemoveAllowance message. Does not implicitly {@link proto.NftRemoveAllowance.verify|verify} messages. + * @function encode + * @memberof proto.NftRemoveAllowance + * @static + * @param {proto.INftRemoveAllowance} m NftRemoveAllowance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftRemoveAllowance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.owner != null && Object.hasOwnProperty.call(m, "owner")) + $root.proto.AccountID.encode(m.owner, w.uint32(18).fork()).ldelim(); + if (m.serialNumbers != null && m.serialNumbers.length) { + w.uint32(26).fork(); + for (var i = 0; i < m.serialNumbers.length; ++i) + w.int64(m.serialNumbers[i]); + w.ldelim(); + } + return w; + }; + + /** + * Decodes a NftRemoveAllowance message from the specified reader or buffer. + * @function decode + * @memberof proto.NftRemoveAllowance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftRemoveAllowance} NftRemoveAllowance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftRemoveAllowance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftRemoveAllowance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.owner = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.serialNumbers && m.serialNumbers.length)) + m.serialNumbers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.serialNumbers.push(r.int64()); + } else + m.serialNumbers.push(r.int64()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftRemoveAllowance + * @function getTypeUrl + * @memberof proto.NftRemoveAllowance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftRemoveAllowance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftRemoveAllowance"; + }; + + return NftRemoveAllowance; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_delete_transaction.d.ts b/packages/proto/src/minimal/crypto_delete_transaction.d.ts new file mode 100644 index 0000000000..ea628b59cb --- /dev/null +++ b/packages/proto/src/minimal/crypto_delete_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_delete_transaction; + +declare namespace hashgraph_crypto_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto account deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete an Hedera account. */ + cryptoDelete?: (proto.ICryptoDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto account deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete an Hedera account. */ + public cryptoDelete?: (proto.ICryptoDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoDelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoDeleteTransactionBody. */ + interface ICryptoDeleteTransactionBody { + + /** The account ID to receive any remaining hbars from the deleted account. */ + transferAccountID?: (proto.IAccountID|null); + + /** The account ID to delete. */ + deleteAccountID?: (proto.IAccountID|null); + } + + /** Mark an account as deleted, transferring its current hbar balance to another account. */ + class CryptoDeleteTransactionBody implements ICryptoDeleteTransactionBody { + + /** + * Constructs a new CryptoDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoDeleteTransactionBody); + + /** The account ID to receive any remaining hbars from the deleted account. */ + public transferAccountID?: (proto.IAccountID|null); + + /** The account ID to delete. */ + public deleteAccountID?: (proto.IAccountID|null); + + /** + * Creates a new CryptoDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoDeleteTransactionBody instance + */ + public static create(properties?: proto.ICryptoDeleteTransactionBody): proto.CryptoDeleteTransactionBody; + + /** + * Encodes the specified CryptoDeleteTransactionBody message. Does not implicitly {@link proto.CryptoDeleteTransactionBody.verify|verify} messages. + * @param m CryptoDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoDeleteTransactionBody; + + /** + * Gets the default type url for CryptoDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_delete_transaction.js b/packages/proto/src/minimal/crypto_delete_transaction.js new file mode 100644 index 0000000000..a9dbf80b26 --- /dev/null +++ b/packages/proto/src/minimal/crypto_delete_transaction.js @@ -0,0 +1,11132 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_delete_transaction || ($protobuf.roots.hashgraph_crypto_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto account deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoDeleteTransactionBody|null} [cryptoDelete] Delete an Hedera account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto account deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete an Hedera account. + * @member {proto.ICryptoDeleteTransactionBody|null|undefined} cryptoDelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoDelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoDelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoDelete != null && Object.hasOwnProperty.call(m, "cryptoDelete")) + $root.proto.CryptoDeleteTransactionBody.encode(m.cryptoDelete, w.uint32(66).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.cryptoDelete = $root.proto.CryptoDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.CryptoDeleteTransactionBody = (function() { + + /** + * Properties of a CryptoDeleteTransactionBody. + * @memberof proto + * @interface ICryptoDeleteTransactionBody + * @property {proto.IAccountID|null} [transferAccountID] The account ID to receive any remaining hbars from the deleted account. + * @property {proto.IAccountID|null} [deleteAccountID] The account ID to delete. + */ + + /** + * Constructs a new CryptoDeleteTransactionBody. + * @memberof proto + * @classdesc Mark an account as deleted, transferring its current hbar balance to another account. + * @implements ICryptoDeleteTransactionBody + * @constructor + * @param {proto.ICryptoDeleteTransactionBody=} [p] Properties to set + */ + function CryptoDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account ID to receive any remaining hbars from the deleted account. + * @member {proto.IAccountID|null|undefined} transferAccountID + * @memberof proto.CryptoDeleteTransactionBody + * @instance + */ + CryptoDeleteTransactionBody.prototype.transferAccountID = null; + + /** + * The account ID to delete. + * @member {proto.IAccountID|null|undefined} deleteAccountID + * @memberof proto.CryptoDeleteTransactionBody + * @instance + */ + CryptoDeleteTransactionBody.prototype.deleteAccountID = null; + + /** + * Creates a new CryptoDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoDeleteTransactionBody + * @static + * @param {proto.ICryptoDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoDeleteTransactionBody} CryptoDeleteTransactionBody instance + */ + CryptoDeleteTransactionBody.create = function create(properties) { + return new CryptoDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoDeleteTransactionBody message. Does not implicitly {@link proto.CryptoDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoDeleteTransactionBody + * @static + * @param {proto.ICryptoDeleteTransactionBody} m CryptoDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transferAccountID != null && Object.hasOwnProperty.call(m, "transferAccountID")) + $root.proto.AccountID.encode(m.transferAccountID, w.uint32(10).fork()).ldelim(); + if (m.deleteAccountID != null && Object.hasOwnProperty.call(m, "deleteAccountID")) + $root.proto.AccountID.encode(m.deleteAccountID, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CryptoDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoDeleteTransactionBody} CryptoDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transferAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.deleteAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoDeleteTransactionBody"; + }; + + return CryptoDeleteTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_transfer_transaction.d.ts b/packages/proto/src/minimal/crypto_transfer_transaction.d.ts new file mode 100644 index 0000000000..a3d152babe --- /dev/null +++ b/packages/proto/src/minimal/crypto_transfer_transaction.d.ts @@ -0,0 +1,6456 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_transfer_transaction; + +declare namespace hashgraph_crypto_transfer_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto transfers. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Transfer HBAR between accounts. */ + cryptoTransfer?: (proto.ICryptoTransferTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto transfers. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Transfer HBAR between accounts. */ + public cryptoTransfer?: (proto.ICryptoTransferTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoTransfer"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoTransferTransactionBody. */ + interface ICryptoTransferTransactionBody { + + /** + * A list of HBAR transfers. + *

+ * Each transfer in this list MUST be denominated in tinybar. + */ + transfers?: (proto.ITransferList|null); + + /** + * One or more lists of token transfers. + *

+ * This list MUST NOT contain more than 10 entries.
+ * If custom fees must be charged, the fee SHALL be assessed against the + * effective "payer" for this transaction.
+ * If the effective "payer" for this transaction lacks sufficient balance + * to pay custom fees assessed, the entire transaction SHALL fail with a + * response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`. + */ + tokenTransfers?: (proto.ITokenTransferList[]|null); + } + + /** + * Transfer HBAR and/or other tokens among two or more accounts and/or smart + * contracts. + * + * Transfers of HBAR or fungible/common tokens in this transaction are + * structured as a "double-entry" transfer list which debits one or more + * accounts, and separately credits one or more accounts. Each such transfer + * list may specify up to 10 individual credits or debits.
+ * Transfers of non-fungible/unique tokens in this transaction are + * structured as a "single-entry" transfer list, which both debits one account + * and credits another account in a single entry. + * + * At least one transfer MUST be present, this MAY be an HBAR transfer in + * `transfers`, or MAY be a token transfer in `tokenTransfers`.
+ * Either `transfers` or `tokenTransfers` MAY be unset, provided the other + * is set and not empty.
+ * If any one account with a debit in any transfer list holds insufficient + * balance to complete the transfer, the entire transaction SHALL fail, and + * all transfers SHALL NOT be completed.
+ * If any one account that is _sending_ an individual non-fungible/unique (NFT) + * token does not currently hold that unique NFT, the entire transaction SHALL + * FAIL, and all transfers SHALL NOT be completed. + * The transaction fee SHALL be charged for a transaction that fails due to + * insufficient balance or not holding the NFT to be transferred.
+ * Each account with any debit amounts in any transfer list MUST sign this + * transaction.
+ * Each account with any credit amounts in any transfer list that also has the + * `receiverSigRequired` flag set MUST sign this transaction. + * + * ### Block Stream Effects + * All debits and credits completed by this transaction SHALL be included in + * the transaction result transfer list.
+ * Multiple fungible/common debits from one account, or credits to one account, + * MAY be consolidated to a single debit or credit entry in the + * transaction result.
+ * Multiple non-fungible/unique transfers SHALL NOT be consolidated in the + * transaction result. + */ + class CryptoTransferTransactionBody implements ICryptoTransferTransactionBody { + + /** + * Constructs a new CryptoTransferTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoTransferTransactionBody); + + /** + * A list of HBAR transfers. + *

+ * Each transfer in this list MUST be denominated in tinybar. + */ + public transfers?: (proto.ITransferList|null); + + /** + * One or more lists of token transfers. + *

+ * This list MUST NOT contain more than 10 entries.
+ * If custom fees must be charged, the fee SHALL be assessed against the + * effective "payer" for this transaction.
+ * If the effective "payer" for this transaction lacks sufficient balance + * to pay custom fees assessed, the entire transaction SHALL fail with a + * response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`. + */ + public tokenTransfers: proto.ITokenTransferList[]; + + /** + * Creates a new CryptoTransferTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoTransferTransactionBody instance + */ + public static create(properties?: proto.ICryptoTransferTransactionBody): proto.CryptoTransferTransactionBody; + + /** + * Encodes the specified CryptoTransferTransactionBody message. Does not implicitly {@link proto.CryptoTransferTransactionBody.verify|verify} messages. + * @param m CryptoTransferTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoTransferTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoTransferTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoTransferTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoTransferTransactionBody; + + /** + * Gets the default type url for CryptoTransferTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_transfer_transaction.js b/packages/proto/src/minimal/crypto_transfer_transaction.js new file mode 100644 index 0000000000..10bb1a2bfa --- /dev/null +++ b/packages/proto/src/minimal/crypto_transfer_transaction.js @@ -0,0 +1,11190 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_transfer_transaction || ($protobuf.roots.hashgraph_crypto_transfer_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto transfers. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoTransferTransactionBody|null} [cryptoTransfer] Transfer HBAR between accounts. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto transfers. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Transfer HBAR between accounts. + * @member {proto.ICryptoTransferTransactionBody|null|undefined} cryptoTransfer + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoTransfer = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoTransfer"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoTransfer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoTransfer != null && Object.hasOwnProperty.call(m, "cryptoTransfer")) + $root.proto.CryptoTransferTransactionBody.encode(m.cryptoTransfer, w.uint32(114).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 14: { + m.cryptoTransfer = $root.proto.CryptoTransferTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + proto.CryptoTransferTransactionBody = (function() { + + /** + * Properties of a CryptoTransferTransactionBody. + * @memberof proto + * @interface ICryptoTransferTransactionBody + * @property {proto.ITransferList|null} [transfers] A list of HBAR transfers. + *

+ * Each transfer in this list MUST be denominated in tinybar. + * @property {Array.|null} [tokenTransfers] One or more lists of token transfers. + *

+ * This list MUST NOT contain more than 10 entries.
+ * If custom fees must be charged, the fee SHALL be assessed against the + * effective "payer" for this transaction.
+ * If the effective "payer" for this transaction lacks sufficient balance + * to pay custom fees assessed, the entire transaction SHALL fail with a + * response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`. + */ + + /** + * Constructs a new CryptoTransferTransactionBody. + * @memberof proto + * @classdesc Transfer HBAR and/or other tokens among two or more accounts and/or smart + * contracts. + * + * Transfers of HBAR or fungible/common tokens in this transaction are + * structured as a "double-entry" transfer list which debits one or more + * accounts, and separately credits one or more accounts. Each such transfer + * list may specify up to 10 individual credits or debits.
+ * Transfers of non-fungible/unique tokens in this transaction are + * structured as a "single-entry" transfer list, which both debits one account + * and credits another account in a single entry. + * + * At least one transfer MUST be present, this MAY be an HBAR transfer in + * `transfers`, or MAY be a token transfer in `tokenTransfers`.
+ * Either `transfers` or `tokenTransfers` MAY be unset, provided the other + * is set and not empty.
+ * If any one account with a debit in any transfer list holds insufficient + * balance to complete the transfer, the entire transaction SHALL fail, and + * all transfers SHALL NOT be completed.
+ * If any one account that is _sending_ an individual non-fungible/unique (NFT) + * token does not currently hold that unique NFT, the entire transaction SHALL + * FAIL, and all transfers SHALL NOT be completed. + * The transaction fee SHALL be charged for a transaction that fails due to + * insufficient balance or not holding the NFT to be transferred.
+ * Each account with any debit amounts in any transfer list MUST sign this + * transaction.
+ * Each account with any credit amounts in any transfer list that also has the + * `receiverSigRequired` flag set MUST sign this transaction. + * + * ### Block Stream Effects + * All debits and credits completed by this transaction SHALL be included in + * the transaction result transfer list.
+ * Multiple fungible/common debits from one account, or credits to one account, + * MAY be consolidated to a single debit or credit entry in the + * transaction result.
+ * Multiple non-fungible/unique transfers SHALL NOT be consolidated in the + * transaction result. + * @implements ICryptoTransferTransactionBody + * @constructor + * @param {proto.ICryptoTransferTransactionBody=} [p] Properties to set + */ + function CryptoTransferTransactionBody(p) { + this.tokenTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of HBAR transfers. + *

+ * Each transfer in this list MUST be denominated in tinybar. + * @member {proto.ITransferList|null|undefined} transfers + * @memberof proto.CryptoTransferTransactionBody + * @instance + */ + CryptoTransferTransactionBody.prototype.transfers = null; + + /** + * One or more lists of token transfers. + *

+ * This list MUST NOT contain more than 10 entries.
+ * If custom fees must be charged, the fee SHALL be assessed against the + * effective "payer" for this transaction.
+ * If the effective "payer" for this transaction lacks sufficient balance + * to pay custom fees assessed, the entire transaction SHALL fail with a + * response code `INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE`. + * @member {Array.} tokenTransfers + * @memberof proto.CryptoTransferTransactionBody + * @instance + */ + CryptoTransferTransactionBody.prototype.tokenTransfers = $util.emptyArray; + + /** + * Creates a new CryptoTransferTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoTransferTransactionBody + * @static + * @param {proto.ICryptoTransferTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoTransferTransactionBody} CryptoTransferTransactionBody instance + */ + CryptoTransferTransactionBody.create = function create(properties) { + return new CryptoTransferTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoTransferTransactionBody message. Does not implicitly {@link proto.CryptoTransferTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoTransferTransactionBody + * @static + * @param {proto.ICryptoTransferTransactionBody} m CryptoTransferTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoTransferTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transfers != null && Object.hasOwnProperty.call(m, "transfers")) + $root.proto.TransferList.encode(m.transfers, w.uint32(10).fork()).ldelim(); + if (m.tokenTransfers != null && m.tokenTransfers.length) { + for (var i = 0; i < m.tokenTransfers.length; ++i) + $root.proto.TokenTransferList.encode(m.tokenTransfers[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CryptoTransferTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoTransferTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoTransferTransactionBody} CryptoTransferTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoTransferTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoTransferTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transfers = $root.proto.TransferList.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.tokenTransfers && m.tokenTransfers.length)) + m.tokenTransfers = []; + m.tokenTransfers.push($root.proto.TokenTransferList.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoTransferTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoTransferTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoTransferTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoTransferTransactionBody"; + }; + + return CryptoTransferTransactionBody; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/crypto_update_transaction.d.ts b/packages/proto/src/minimal/crypto_update_transaction.d.ts new file mode 100644 index 0000000000..4e1e0431ba --- /dev/null +++ b/packages/proto/src/minimal/crypto_update_transaction.d.ts @@ -0,0 +1,6450 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_crypto_update_transaction; + +declare namespace hashgraph_crypto_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for crypto account updates. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Modify an Hedera account. */ + cryptoUpdateAccount?: (proto.ICryptoUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for crypto account updates. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Modify an Hedera account. */ + public cryptoUpdateAccount?: (proto.ICryptoUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "cryptoUpdateAccount"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CryptoUpdateTransactionBody. */ + interface ICryptoUpdateTransactionBody { + + /** The account ID to update. */ + accountIDToUpdate?: (proto.IAccountID|null); + + /** The new key for the account. */ + key?: (proto.IKey|null); + + /** Use staked_id instead. */ + proxyAccountID?: (proto.IAccountID|null); + + /** The new expiry time for the account. */ + expirationTime?: (proto.ITimestamp|null); + + /** The new period that the account will be charged. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** If set to the sentinel value of 0.0.0, this field removes the account's receiver signature requirement. */ + receiverSigRequiredWrapper?: (boolean|null); + + /** If set, the new memo to be associated with the account. */ + memo?: (string|null); + + /** The maximum number of tokens that this account can be automatically associated with. */ + maxAutomaticTokenAssociations?: (number|null); + + /** ID of the account to which this account is staking. */ + stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this account is staked to. */ + stakedNodeId?: (Long|null); + + /** If true, the account declines receiving a staking reward. */ + declineReward?: (boolean|null); + } + + /** Change properties for the given account. */ + class CryptoUpdateTransactionBody implements ICryptoUpdateTransactionBody { + + /** + * Constructs a new CryptoUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ICryptoUpdateTransactionBody); + + /** The account ID to update. */ + public accountIDToUpdate?: (proto.IAccountID|null); + + /** The new key for the account. */ + public key?: (proto.IKey|null); + + /** Use staked_id instead. */ + public proxyAccountID?: (proto.IAccountID|null); + + /** The new expiry time for the account. */ + public expirationTime?: (proto.ITimestamp|null); + + /** The new period that the account will be charged. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** If set to the sentinel value of 0.0.0, this field removes the account's receiver signature requirement. */ + public receiverSigRequiredWrapper: boolean; + + /** If set, the new memo to be associated with the account. */ + public memo: string; + + /** The maximum number of tokens that this account can be automatically associated with. */ + public maxAutomaticTokenAssociations: number; + + /** ID of the account to which this account is staking. */ + public stakedAccountId?: (proto.IAccountID|null); + + /** ID of the node this account is staked to. */ + public stakedNodeId?: (Long|null); + + /** If true, the account declines receiving a staking reward. */ + public declineReward: boolean; + + /** CryptoUpdateTransactionBody stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new CryptoUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoUpdateTransactionBody instance + */ + public static create(properties?: proto.ICryptoUpdateTransactionBody): proto.CryptoUpdateTransactionBody; + + /** + * Encodes the specified CryptoUpdateTransactionBody message. Does not implicitly {@link proto.CryptoUpdateTransactionBody.verify|verify} messages. + * @param m CryptoUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICryptoUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CryptoUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CryptoUpdateTransactionBody; + + /** + * Gets the default type url for CryptoUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/crypto_update_transaction.js b/packages/proto/src/minimal/crypto_update_transaction.js new file mode 100644 index 0000000000..450a1447c0 --- /dev/null +++ b/packages/proto/src/minimal/crypto_update_transaction.js @@ -0,0 +1,11281 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_crypto_update_transaction || ($protobuf.roots.hashgraph_crypto_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for crypto account updates. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ICryptoUpdateTransactionBody|null} [cryptoUpdateAccount] Modify an Hedera account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for crypto account updates. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Modify an Hedera account. + * @member {proto.ICryptoUpdateTransactionBody|null|undefined} cryptoUpdateAccount + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.cryptoUpdateAccount = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"cryptoUpdateAccount"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["cryptoUpdateAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.cryptoUpdateAccount != null && Object.hasOwnProperty.call(m, "cryptoUpdateAccount")) + $root.proto.CryptoUpdateTransactionBody.encode(m.cryptoUpdateAccount, w.uint32(82).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 10: { + m.cryptoUpdateAccount = $root.proto.CryptoUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.CryptoUpdateTransactionBody = (function() { + + /** + * Properties of a CryptoUpdateTransactionBody. + * @memberof proto + * @interface ICryptoUpdateTransactionBody + * @property {proto.IAccountID|null} [accountIDToUpdate] The account ID to update. + * @property {proto.IKey|null} [key] The new key for the account. + * @property {proto.IAccountID|null} [proxyAccountID] Use staked_id instead. + * @property {proto.ITimestamp|null} [expirationTime] The new expiry time for the account. + * @property {proto.IDuration|null} [autoRenewPeriod] The new period that the account will be charged. + * @property {boolean|null} [receiverSigRequiredWrapper] If set to the sentinel value of 0.0.0, this field removes the account's receiver signature requirement. + * @property {string|null} [memo] If set, the new memo to be associated with the account. + * @property {number|null} [maxAutomaticTokenAssociations] The maximum number of tokens that this account can be automatically associated with. + * @property {proto.IAccountID|null} [stakedAccountId] ID of the account to which this account is staking. + * @property {Long|null} [stakedNodeId] ID of the node this account is staked to. + * @property {boolean|null} [declineReward] If true, the account declines receiving a staking reward. + */ + + /** + * Constructs a new CryptoUpdateTransactionBody. + * @memberof proto + * @classdesc Change properties for the given account. + * @implements ICryptoUpdateTransactionBody + * @constructor + * @param {proto.ICryptoUpdateTransactionBody=} [p] Properties to set + */ + function CryptoUpdateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account ID to update. + * @member {proto.IAccountID|null|undefined} accountIDToUpdate + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.accountIDToUpdate = null; + + /** + * The new key for the account. + * @member {proto.IKey|null|undefined} key + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.key = null; + + /** + * Use staked_id instead. + * @member {proto.IAccountID|null|undefined} proxyAccountID + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.proxyAccountID = null; + + /** + * The new expiry time for the account. + * @member {proto.ITimestamp|null|undefined} expirationTime + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.expirationTime = null; + + /** + * The new period that the account will be charged. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * If set to the sentinel value of 0.0.0, this field removes the account's receiver signature requirement. + * @member {boolean} receiverSigRequiredWrapper + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.receiverSigRequiredWrapper = false; + + /** + * If set, the new memo to be associated with the account. + * @member {string} memo + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.memo = ""; + + /** + * The maximum number of tokens that this account can be automatically associated with. + * @member {number} maxAutomaticTokenAssociations + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.maxAutomaticTokenAssociations = 0; + + /** + * ID of the account to which this account is staking. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.stakedAccountId = null; + + /** + * ID of the node this account is staked to. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.stakedNodeId = null; + + /** + * If true, the account declines receiving a staking reward. + * @member {boolean} declineReward + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + CryptoUpdateTransactionBody.prototype.declineReward = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CryptoUpdateTransactionBody stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.CryptoUpdateTransactionBody + * @instance + */ + Object.defineProperty(CryptoUpdateTransactionBody.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CryptoUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.CryptoUpdateTransactionBody + * @static + * @param {proto.ICryptoUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.CryptoUpdateTransactionBody} CryptoUpdateTransactionBody instance + */ + CryptoUpdateTransactionBody.create = function create(properties) { + return new CryptoUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified CryptoUpdateTransactionBody message. Does not implicitly {@link proto.CryptoUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.CryptoUpdateTransactionBody + * @static + * @param {proto.ICryptoUpdateTransactionBody} m CryptoUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountIDToUpdate != null && Object.hasOwnProperty.call(m, "accountIDToUpdate")) + $root.proto.AccountID.encode(m.accountIDToUpdate, w.uint32(18).fork()).ldelim(); + if (m.key != null && Object.hasOwnProperty.call(m, "key")) + $root.proto.Key.encode(m.key, w.uint32(26).fork()).ldelim(); + if (m.proxyAccountID != null && Object.hasOwnProperty.call(m, "proxyAccountID")) + $root.proto.AccountID.encode(m.proxyAccountID, w.uint32(34).fork()).ldelim(); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.Timestamp.encode(m.expirationTime, w.uint32(50).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(58).fork()).ldelim(); + if (m.receiverSigRequiredWrapper != null && Object.hasOwnProperty.call(m, "receiverSigRequiredWrapper")) + w.uint32(64).bool(m.receiverSigRequiredWrapper); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(74).string(m.memo); + if (m.maxAutomaticTokenAssociations != null && Object.hasOwnProperty.call(m, "maxAutomaticTokenAssociations")) + w.uint32(80).int32(m.maxAutomaticTokenAssociations); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(90).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(96).int64(m.stakedNodeId); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(104).bool(m.declineReward); + return w; + }; + + /** + * Decodes a CryptoUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.CryptoUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CryptoUpdateTransactionBody} CryptoUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CryptoUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.accountIDToUpdate = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.key = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 4: { + m.proxyAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.expirationTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 7: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 8: { + m.receiverSigRequiredWrapper = r.bool(); + break; + } + case 9: { + m.memo = r.string(); + break; + } + case 10: { + m.maxAutomaticTokenAssociations = r.int32(); + break; + } + case 11: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 12: { + m.stakedNodeId = r.int64(); + break; + } + case 13: { + m.declineReward = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CryptoUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.CryptoUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CryptoUpdateTransactionBody"; + }; + + return CryptoUpdateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/ethereum_transaction_transaction.d.ts b/packages/proto/src/minimal/ethereum_transaction_transaction.d.ts new file mode 100644 index 0000000000..95a9002513 --- /dev/null +++ b/packages/proto/src/minimal/ethereum_transaction_transaction.d.ts @@ -0,0 +1,6399 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_ethereum_transaction_transaction; + +declare namespace hashgraph_ethereum_transaction_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for Ethereum transactions. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EthereumTransactionBody. */ + interface IEthereumTransactionBody { + + /** The raw Ethereum transaction data. */ + ethereumData?: (Uint8Array|null); + + /** The callData for the Ethereum transaction. */ + callData?: (proto.IFileID|null); + + /** A maximum amount of gas offered to pay the Ethereum transaction costs. */ + maxGasAllowance?: (Long|null); + } + + /** A transaction in Ethereum format. */ + class EthereumTransactionBody implements IEthereumTransactionBody { + + /** + * Constructs a new EthereumTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IEthereumTransactionBody); + + /** The raw Ethereum transaction data. */ + public ethereumData: Uint8Array; + + /** The callData for the Ethereum transaction. */ + public callData?: (proto.IFileID|null); + + /** A maximum amount of gas offered to pay the Ethereum transaction costs. */ + public maxGasAllowance: Long; + + /** + * Creates a new EthereumTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns EthereumTransactionBody instance + */ + public static create(properties?: proto.IEthereumTransactionBody): proto.EthereumTransactionBody; + + /** + * Encodes the specified EthereumTransactionBody message. Does not implicitly {@link proto.EthereumTransactionBody.verify|verify} messages. + * @param m EthereumTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IEthereumTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EthereumTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns EthereumTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.EthereumTransactionBody; + + /** + * Gets the default type url for EthereumTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Perform an Ethereum encoded transaction. */ + ethereumTransaction?: (proto.IEthereumTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for Ethereum transactions. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Perform an Ethereum encoded transaction. */ + public ethereumTransaction?: (proto.IEthereumTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "ethereumTransaction"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/ethereum_transaction_transaction.js b/packages/proto/src/minimal/ethereum_transaction_transaction.js new file mode 100644 index 0000000000..07a0e0cd8f --- /dev/null +++ b/packages/proto/src/minimal/ethereum_transaction_transaction.js @@ -0,0 +1,11147 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_ethereum_transaction_transaction || ($protobuf.roots.hashgraph_ethereum_transaction_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for Ethereum transactions. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.EthereumTransactionBody = (function() { + + /** + * Properties of an EthereumTransactionBody. + * @memberof proto + * @interface IEthereumTransactionBody + * @property {Uint8Array|null} [ethereumData] The raw Ethereum transaction data. + * @property {proto.IFileID|null} [callData] The callData for the Ethereum transaction. + * @property {Long|null} [maxGasAllowance] A maximum amount of gas offered to pay the Ethereum transaction costs. + */ + + /** + * Constructs a new EthereumTransactionBody. + * @memberof proto + * @classdesc A transaction in Ethereum format. + * @implements IEthereumTransactionBody + * @constructor + * @param {proto.IEthereumTransactionBody=} [p] Properties to set + */ + function EthereumTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The raw Ethereum transaction data. + * @member {Uint8Array} ethereumData + * @memberof proto.EthereumTransactionBody + * @instance + */ + EthereumTransactionBody.prototype.ethereumData = $util.newBuffer([]); + + /** + * The callData for the Ethereum transaction. + * @member {proto.IFileID|null|undefined} callData + * @memberof proto.EthereumTransactionBody + * @instance + */ + EthereumTransactionBody.prototype.callData = null; + + /** + * A maximum amount of gas offered to pay the Ethereum transaction costs. + * @member {Long} maxGasAllowance + * @memberof proto.EthereumTransactionBody + * @instance + */ + EthereumTransactionBody.prototype.maxGasAllowance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EthereumTransactionBody instance using the specified properties. + * @function create + * @memberof proto.EthereumTransactionBody + * @static + * @param {proto.IEthereumTransactionBody=} [properties] Properties to set + * @returns {proto.EthereumTransactionBody} EthereumTransactionBody instance + */ + EthereumTransactionBody.create = function create(properties) { + return new EthereumTransactionBody(properties); + }; + + /** + * Encodes the specified EthereumTransactionBody message. Does not implicitly {@link proto.EthereumTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.EthereumTransactionBody + * @static + * @param {proto.IEthereumTransactionBody} m EthereumTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EthereumTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ethereumData != null && Object.hasOwnProperty.call(m, "ethereumData")) + w.uint32(10).bytes(m.ethereumData); + if (m.callData != null && Object.hasOwnProperty.call(m, "callData")) + $root.proto.FileID.encode(m.callData, w.uint32(18).fork()).ldelim(); + if (m.maxGasAllowance != null && Object.hasOwnProperty.call(m, "maxGasAllowance")) + w.uint32(24).int64(m.maxGasAllowance); + return w; + }; + + /** + * Decodes an EthereumTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.EthereumTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.EthereumTransactionBody} EthereumTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EthereumTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.EthereumTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ethereumData = r.bytes(); + break; + } + case 2: { + m.callData = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 3: { + m.maxGasAllowance = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for EthereumTransactionBody + * @function getTypeUrl + * @memberof proto.EthereumTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EthereumTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.EthereumTransactionBody"; + }; + + return EthereumTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IEthereumTransactionBody|null} [ethereumTransaction] Perform an Ethereum encoded transaction. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for Ethereum transactions. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Perform an Ethereum encoded transaction. + * @member {proto.IEthereumTransactionBody|null|undefined} ethereumTransaction + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.ethereumTransaction = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"ethereumTransaction"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["ethereumTransaction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.ethereumTransaction != null && Object.hasOwnProperty.call(m, "ethereumTransaction")) + $root.proto.EthereumTransactionBody.encode(m.ethereumTransaction, w.uint32(402).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 50: { + m.ethereumTransaction = $root.proto.EthereumTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/file_append_transaction.d.ts b/packages/proto/src/minimal/file_append_transaction.d.ts new file mode 100644 index 0000000000..94f75b1d6e --- /dev/null +++ b/packages/proto/src/minimal/file_append_transaction.d.ts @@ -0,0 +1,6465 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_file_append_transaction; + +declare namespace hashgraph_file_append_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + bodyBytes?: (Uint8Array|null); + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** + * A wrapper around signed transaction bytes.
+ * This was originally a transaction with body, signatures, and/or bytes, + * but is not only a wrapper around a byte array containing signed transction + * bytes. + * + * The `signedTransactionBytes` field is REQUIRED and MUST contain a valid, + * serialized, `SignedTransaction` message.
+ * All other fields are deprecated and MUST NOT be set. + * + * #### Additional Notes + * The four deprecated fields will be removed and reserved in a future release. + */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + public body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + public sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + public bodyBytes: Uint8Array; + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Append data to the end of a file. */ + fileAppend?: (proto.IFileAppendTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for file append. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Append data to the end of a file. */ + public fileAppend?: (proto.IFileAppendTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "fileAppend"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileAppendTransactionBody. */ + interface IFileAppendTransactionBody { + + /** The file ID to append to. */ + fileID?: (proto.IFileID|null); + + /** The bytes to append to the contents of the file. */ + contents?: (Uint8Array|null); + } + + /** Append the given contents to the end of the specified file. */ + class FileAppendTransactionBody implements IFileAppendTransactionBody { + + /** + * Constructs a new FileAppendTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileAppendTransactionBody); + + /** The file ID to append to. */ + public fileID?: (proto.IFileID|null); + + /** The bytes to append to the contents of the file. */ + public contents: Uint8Array; + + /** + * Creates a new FileAppendTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns FileAppendTransactionBody instance + */ + public static create(properties?: proto.IFileAppendTransactionBody): proto.FileAppendTransactionBody; + + /** + * Encodes the specified FileAppendTransactionBody message. Does not implicitly {@link proto.FileAppendTransactionBody.verify|verify} messages. + * @param m FileAppendTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileAppendTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileAppendTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileAppendTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileAppendTransactionBody; + + /** + * Gets the default type url for FileAppendTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/file_append_transaction.js b/packages/proto/src/minimal/file_append_transaction.js new file mode 100644 index 0000000000..9d9fcfb86c --- /dev/null +++ b/packages/proto/src/minimal/file_append_transaction.js @@ -0,0 +1,11218 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_file_append_transaction || ($protobuf.roots.hashgraph_file_append_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {proto.ITransactionBody|null} [body] Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + * @property {proto.ISignatureList|null} [sigs] Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + * @property {proto.ISignatureMap|null} [sigMap] Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + * @property {Uint8Array|null} [bodyBytes] Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes.
+ * This was originally a transaction with body, signatures, and/or bytes, + * but is not only a wrapper around a byte array containing signed transction + * bytes. + * + * The `signedTransactionBytes` field is REQUIRED and MUST contain a valid, + * serialized, `SignedTransaction` message.
+ * All other fields are deprecated and MUST NOT be set. + * + * #### Additional Notes + * The four deprecated fields will be removed and reserved in a future release. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + * @member {proto.ITransactionBody|null|undefined} body + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.body = null; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.sigs = null; + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + * @member {proto.ISignatureMap|null|undefined} sigMap + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.sigMap = null; + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + * @member {Uint8Array} bodyBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.bodyBytes = $util.newBuffer([]); + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.body != null && Object.hasOwnProperty.call(m, "body")) + $root.proto.TransactionBody.encode(m.body, w.uint32(10).fork()).ldelim(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + if (m.sigMap != null && Object.hasOwnProperty.call(m, "sigMap")) + $root.proto.SignatureMap.encode(m.sigMap, w.uint32(26).fork()).ldelim(); + if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) + w.uint32(34).bytes(m.bodyBytes); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.body = $root.proto.TransactionBody.decode(r, r.uint32()); + break; + } + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + case 3: { + m.sigMap = $root.proto.SignatureMap.decode(r, r.uint32()); + break; + } + case 4: { + m.bodyBytes = r.bytes(); + break; + } + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IFileAppendTransactionBody|null} [fileAppend] Append data to the end of a file. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for file append. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Append data to the end of a file. + * @member {proto.IFileAppendTransactionBody|null|undefined} fileAppend + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.fileAppend = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"fileAppend"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["fileAppend"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.fileAppend != null && Object.hasOwnProperty.call(m, "fileAppend")) + $root.proto.FileAppendTransactionBody.encode(m.fileAppend, w.uint32(130).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 16: { + m.fileAppend = $root.proto.FileAppendTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.FileAppendTransactionBody = (function() { + + /** + * Properties of a FileAppendTransactionBody. + * @memberof proto + * @interface IFileAppendTransactionBody + * @property {proto.IFileID|null} [fileID] The file ID to append to. + * @property {Uint8Array|null} [contents] The bytes to append to the contents of the file. + */ + + /** + * Constructs a new FileAppendTransactionBody. + * @memberof proto + * @classdesc Append the given contents to the end of the specified file. + * @implements IFileAppendTransactionBody + * @constructor + * @param {proto.IFileAppendTransactionBody=} [p] Properties to set + */ + function FileAppendTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The file ID to append to. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.FileAppendTransactionBody + * @instance + */ + FileAppendTransactionBody.prototype.fileID = null; + + /** + * The bytes to append to the contents of the file. + * @member {Uint8Array} contents + * @memberof proto.FileAppendTransactionBody + * @instance + */ + FileAppendTransactionBody.prototype.contents = $util.newBuffer([]); + + /** + * Creates a new FileAppendTransactionBody instance using the specified properties. + * @function create + * @memberof proto.FileAppendTransactionBody + * @static + * @param {proto.IFileAppendTransactionBody=} [properties] Properties to set + * @returns {proto.FileAppendTransactionBody} FileAppendTransactionBody instance + */ + FileAppendTransactionBody.create = function create(properties) { + return new FileAppendTransactionBody(properties); + }; + + /** + * Encodes the specified FileAppendTransactionBody message. Does not implicitly {@link proto.FileAppendTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.FileAppendTransactionBody + * @static + * @param {proto.IFileAppendTransactionBody} m FileAppendTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileAppendTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(18).fork()).ldelim(); + if (m.contents != null && Object.hasOwnProperty.call(m, "contents")) + w.uint32(34).bytes(m.contents); + return w; + }; + + /** + * Decodes a FileAppendTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.FileAppendTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileAppendTransactionBody} FileAppendTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileAppendTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileAppendTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 4: { + m.contents = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileAppendTransactionBody + * @function getTypeUrl + * @memberof proto.FileAppendTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileAppendTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileAppendTransactionBody"; + }; + + return FileAppendTransactionBody; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/file_create_transaction.d.ts b/packages/proto/src/minimal/file_create_transaction.d.ts new file mode 100644 index 0000000000..082d456a81 --- /dev/null +++ b/packages/proto/src/minimal/file_create_transaction.d.ts @@ -0,0 +1,6423 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_file_create_transaction; + +declare namespace hashgraph_file_create_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for file creation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a new file. */ + fileCreate?: (proto.IFileCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for file creation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a new file. */ + public fileCreate?: (proto.IFileCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "fileCreate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileCreateTransactionBody. */ + interface IFileCreateTransactionBody { + + /** The time at which this file should expire. */ + expirationTime?: (proto.ITimestamp|null); + + /** All keys at the top level of a key list must sign to create or modify the file. */ + keys?: (proto.IKeyList|null); + + /** The bytes that are the contents of the file. */ + contents?: (Uint8Array|null); + + /** Shard in which this file is created. */ + shardID?: (proto.IShardID|null); + + /** The realm in which this file is created. */ + realmID?: (proto.IRealmID|null); + + /** If realmID is specified, then this the admin key for that realm. */ + newRealmAdminKey?: (proto.IKey|null); + + /** The memo associated with the file. */ + memo?: (string|null); + } + + /** Create a new file. */ + class FileCreateTransactionBody implements IFileCreateTransactionBody { + + /** + * Constructs a new FileCreateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileCreateTransactionBody); + + /** The time at which this file should expire. */ + public expirationTime?: (proto.ITimestamp|null); + + /** All keys at the top level of a key list must sign to create or modify the file. */ + public keys?: (proto.IKeyList|null); + + /** The bytes that are the contents of the file. */ + public contents: Uint8Array; + + /** Shard in which this file is created. */ + public shardID?: (proto.IShardID|null); + + /** The realm in which this file is created. */ + public realmID?: (proto.IRealmID|null); + + /** If realmID is specified, then this the admin key for that realm. */ + public newRealmAdminKey?: (proto.IKey|null); + + /** The memo associated with the file. */ + public memo: string; + + /** + * Creates a new FileCreateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns FileCreateTransactionBody instance + */ + public static create(properties?: proto.IFileCreateTransactionBody): proto.FileCreateTransactionBody; + + /** + * Encodes the specified FileCreateTransactionBody message. Does not implicitly {@link proto.FileCreateTransactionBody.verify|verify} messages. + * @param m FileCreateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileCreateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileCreateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileCreateTransactionBody; + + /** + * Gets the default type url for FileCreateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/file_create_transaction.js b/packages/proto/src/minimal/file_create_transaction.js new file mode 100644 index 0000000000..2ca1a5682f --- /dev/null +++ b/packages/proto/src/minimal/file_create_transaction.js @@ -0,0 +1,11207 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_file_create_transaction || ($protobuf.roots.hashgraph_file_create_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for file creation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IFileCreateTransactionBody|null} [fileCreate] Create a new file. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for file creation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a new file. + * @member {proto.IFileCreateTransactionBody|null|undefined} fileCreate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.fileCreate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"fileCreate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["fileCreate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.fileCreate != null && Object.hasOwnProperty.call(m, "fileCreate")) + $root.proto.FileCreateTransactionBody.encode(m.fileCreate, w.uint32(138).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 17: { + m.fileCreate = $root.proto.FileCreateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.FileCreateTransactionBody = (function() { + + /** + * Properties of a FileCreateTransactionBody. + * @memberof proto + * @interface IFileCreateTransactionBody + * @property {proto.ITimestamp|null} [expirationTime] The time at which this file should expire. + * @property {proto.IKeyList|null} [keys] All keys at the top level of a key list must sign to create or modify the file. + * @property {Uint8Array|null} [contents] The bytes that are the contents of the file. + * @property {proto.IShardID|null} [shardID] Shard in which this file is created. + * @property {proto.IRealmID|null} [realmID] The realm in which this file is created. + * @property {proto.IKey|null} [newRealmAdminKey] If realmID is specified, then this the admin key for that realm. + * @property {string|null} [memo] The memo associated with the file. + */ + + /** + * Constructs a new FileCreateTransactionBody. + * @memberof proto + * @classdesc Create a new file. + * @implements IFileCreateTransactionBody + * @constructor + * @param {proto.IFileCreateTransactionBody=} [p] Properties to set + */ + function FileCreateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The time at which this file should expire. + * @member {proto.ITimestamp|null|undefined} expirationTime + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.expirationTime = null; + + /** + * All keys at the top level of a key list must sign to create or modify the file. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.keys = null; + + /** + * The bytes that are the contents of the file. + * @member {Uint8Array} contents + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.contents = $util.newBuffer([]); + + /** + * Shard in which this file is created. + * @member {proto.IShardID|null|undefined} shardID + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.shardID = null; + + /** + * The realm in which this file is created. + * @member {proto.IRealmID|null|undefined} realmID + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.realmID = null; + + /** + * If realmID is specified, then this the admin key for that realm. + * @member {proto.IKey|null|undefined} newRealmAdminKey + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.newRealmAdminKey = null; + + /** + * The memo associated with the file. + * @member {string} memo + * @memberof proto.FileCreateTransactionBody + * @instance + */ + FileCreateTransactionBody.prototype.memo = ""; + + /** + * Creates a new FileCreateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.FileCreateTransactionBody + * @static + * @param {proto.IFileCreateTransactionBody=} [properties] Properties to set + * @returns {proto.FileCreateTransactionBody} FileCreateTransactionBody instance + */ + FileCreateTransactionBody.create = function create(properties) { + return new FileCreateTransactionBody(properties); + }; + + /** + * Encodes the specified FileCreateTransactionBody message. Does not implicitly {@link proto.FileCreateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.FileCreateTransactionBody + * @static + * @param {proto.IFileCreateTransactionBody} m FileCreateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileCreateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.Timestamp.encode(m.expirationTime, w.uint32(18).fork()).ldelim(); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(26).fork()).ldelim(); + if (m.contents != null && Object.hasOwnProperty.call(m, "contents")) + w.uint32(34).bytes(m.contents); + if (m.shardID != null && Object.hasOwnProperty.call(m, "shardID")) + $root.proto.ShardID.encode(m.shardID, w.uint32(42).fork()).ldelim(); + if (m.realmID != null && Object.hasOwnProperty.call(m, "realmID")) + $root.proto.RealmID.encode(m.realmID, w.uint32(50).fork()).ldelim(); + if (m.newRealmAdminKey != null && Object.hasOwnProperty.call(m, "newRealmAdminKey")) + $root.proto.Key.encode(m.newRealmAdminKey, w.uint32(58).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(66).string(m.memo); + return w; + }; + + /** + * Decodes a FileCreateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.FileCreateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileCreateTransactionBody} FileCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileCreateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileCreateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.expirationTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 4: { + m.contents = r.bytes(); + break; + } + case 5: { + m.shardID = $root.proto.ShardID.decode(r, r.uint32()); + break; + } + case 6: { + m.realmID = $root.proto.RealmID.decode(r, r.uint32()); + break; + } + case 7: { + m.newRealmAdminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.memo = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileCreateTransactionBody + * @function getTypeUrl + * @memberof proto.FileCreateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileCreateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileCreateTransactionBody"; + }; + + return FileCreateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/file_delete_transaction.d.ts b/packages/proto/src/minimal/file_delete_transaction.d.ts new file mode 100644 index 0000000000..91726f86ab --- /dev/null +++ b/packages/proto/src/minimal/file_delete_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_file_delete_transaction; + +declare namespace hashgraph_file_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for file deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a file. */ + fileDelete?: (proto.IFileDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for file deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a file. */ + public fileDelete?: (proto.IFileDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "fileDelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDeleteTransactionBody. */ + interface IFileDeleteTransactionBody { + + /** The file to delete. */ + fileID?: (proto.IFileID|null); + } + + /** Mark a file as deleted. */ + class FileDeleteTransactionBody implements IFileDeleteTransactionBody { + + /** + * Constructs a new FileDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileDeleteTransactionBody); + + /** The file to delete. */ + public fileID?: (proto.IFileID|null); + + /** + * Creates a new FileDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDeleteTransactionBody instance + */ + public static create(properties?: proto.IFileDeleteTransactionBody): proto.FileDeleteTransactionBody; + + /** + * Encodes the specified FileDeleteTransactionBody message. Does not implicitly {@link proto.FileDeleteTransactionBody.verify|verify} messages. + * @param m FileDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileDeleteTransactionBody; + + /** + * Gets the default type url for FileDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/file_delete_transaction.js b/packages/proto/src/minimal/file_delete_transaction.js new file mode 100644 index 0000000000..7ef7d11e5e --- /dev/null +++ b/packages/proto/src/minimal/file_delete_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_file_delete_transaction || ($protobuf.roots.hashgraph_file_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for file deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IFileDeleteTransactionBody|null} [fileDelete] Delete a file. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for file deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a file. + * @member {proto.IFileDeleteTransactionBody|null|undefined} fileDelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.fileDelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"fileDelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["fileDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.fileDelete != null && Object.hasOwnProperty.call(m, "fileDelete")) + $root.proto.FileDeleteTransactionBody.encode(m.fileDelete, w.uint32(146).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 18: { + m.fileDelete = $root.proto.FileDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.FileDeleteTransactionBody = (function() { + + /** + * Properties of a FileDeleteTransactionBody. + * @memberof proto + * @interface IFileDeleteTransactionBody + * @property {proto.IFileID|null} [fileID] The file to delete. + */ + + /** + * Constructs a new FileDeleteTransactionBody. + * @memberof proto + * @classdesc Mark a file as deleted. + * @implements IFileDeleteTransactionBody + * @constructor + * @param {proto.IFileDeleteTransactionBody=} [p] Properties to set + */ + function FileDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The file to delete. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.FileDeleteTransactionBody + * @instance + */ + FileDeleteTransactionBody.prototype.fileID = null; + + /** + * Creates a new FileDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.FileDeleteTransactionBody + * @static + * @param {proto.IFileDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.FileDeleteTransactionBody} FileDeleteTransactionBody instance + */ + FileDeleteTransactionBody.create = function create(properties) { + return new FileDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified FileDeleteTransactionBody message. Does not implicitly {@link proto.FileDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.FileDeleteTransactionBody + * @static + * @param {proto.IFileDeleteTransactionBody} m FileDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FileDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.FileDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileDeleteTransactionBody} FileDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.FileDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileDeleteTransactionBody"; + }; + + return FileDeleteTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/file_update_transaction.d.ts b/packages/proto/src/minimal/file_update_transaction.d.ts new file mode 100644 index 0000000000..25e53a933f --- /dev/null +++ b/packages/proto/src/minimal/file_update_transaction.d.ts @@ -0,0 +1,6411 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_file_update_transaction; + +declare namespace hashgraph_file_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for file updates. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Modify a file. */ + fileUpdate?: (proto.IFileUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for file updates. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Modify a file. */ + public fileUpdate?: (proto.IFileUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "fileUpdate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileUpdateTransactionBody. */ + interface IFileUpdateTransactionBody { + + /** The ID of the file to update. */ + fileID?: (proto.IFileID|null); + + /** The new expiry time. */ + expirationTime?: (proto.ITimestamp|null); + + /** The new list of keys that can modify or delete this file. */ + keys?: (proto.IKeyList|null); + + /** The new contents that should overwrite the file's current contents. */ + contents?: (Uint8Array|null); + + /** If set, the new memo to be associated with the file. */ + memo?: (string|null); + } + + /** Modify the metadata and/or contents of a file. */ + class FileUpdateTransactionBody implements IFileUpdateTransactionBody { + + /** + * Constructs a new FileUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileUpdateTransactionBody); + + /** The ID of the file to update. */ + public fileID?: (proto.IFileID|null); + + /** The new expiry time. */ + public expirationTime?: (proto.ITimestamp|null); + + /** The new list of keys that can modify or delete this file. */ + public keys?: (proto.IKeyList|null); + + /** The new contents that should overwrite the file's current contents. */ + public contents: Uint8Array; + + /** If set, the new memo to be associated with the file. */ + public memo: string; + + /** + * Creates a new FileUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns FileUpdateTransactionBody instance + */ + public static create(properties?: proto.IFileUpdateTransactionBody): proto.FileUpdateTransactionBody; + + /** + * Encodes the specified FileUpdateTransactionBody message. Does not implicitly {@link proto.FileUpdateTransactionBody.verify|verify} messages. + * @param m FileUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileUpdateTransactionBody; + + /** + * Gets the default type url for FileUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/file_update_transaction.js b/packages/proto/src/minimal/file_update_transaction.js new file mode 100644 index 0000000000..45d1952f7d --- /dev/null +++ b/packages/proto/src/minimal/file_update_transaction.js @@ -0,0 +1,11177 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_file_update_transaction || ($protobuf.roots.hashgraph_file_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for file updates. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IFileUpdateTransactionBody|null} [fileUpdate] Modify a file. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for file updates. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Modify a file. + * @member {proto.IFileUpdateTransactionBody|null|undefined} fileUpdate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.fileUpdate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"fileUpdate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["fileUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.fileUpdate != null && Object.hasOwnProperty.call(m, "fileUpdate")) + $root.proto.FileUpdateTransactionBody.encode(m.fileUpdate, w.uint32(154).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 19: { + m.fileUpdate = $root.proto.FileUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.FileUpdateTransactionBody = (function() { + + /** + * Properties of a FileUpdateTransactionBody. + * @memberof proto + * @interface IFileUpdateTransactionBody + * @property {proto.IFileID|null} [fileID] The ID of the file to update. + * @property {proto.ITimestamp|null} [expirationTime] The new expiry time. + * @property {proto.IKeyList|null} [keys] The new list of keys that can modify or delete this file. + * @property {Uint8Array|null} [contents] The new contents that should overwrite the file's current contents. + * @property {string|null} [memo] If set, the new memo to be associated with the file. + */ + + /** + * Constructs a new FileUpdateTransactionBody. + * @memberof proto + * @classdesc Modify the metadata and/or contents of a file. + * @implements IFileUpdateTransactionBody + * @constructor + * @param {proto.IFileUpdateTransactionBody=} [p] Properties to set + */ + function FileUpdateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The ID of the file to update. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.FileUpdateTransactionBody + * @instance + */ + FileUpdateTransactionBody.prototype.fileID = null; + + /** + * The new expiry time. + * @member {proto.ITimestamp|null|undefined} expirationTime + * @memberof proto.FileUpdateTransactionBody + * @instance + */ + FileUpdateTransactionBody.prototype.expirationTime = null; + + /** + * The new list of keys that can modify or delete this file. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.FileUpdateTransactionBody + * @instance + */ + FileUpdateTransactionBody.prototype.keys = null; + + /** + * The new contents that should overwrite the file's current contents. + * @member {Uint8Array} contents + * @memberof proto.FileUpdateTransactionBody + * @instance + */ + FileUpdateTransactionBody.prototype.contents = $util.newBuffer([]); + + /** + * If set, the new memo to be associated with the file. + * @member {string} memo + * @memberof proto.FileUpdateTransactionBody + * @instance + */ + FileUpdateTransactionBody.prototype.memo = ""; + + /** + * Creates a new FileUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.FileUpdateTransactionBody + * @static + * @param {proto.IFileUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.FileUpdateTransactionBody} FileUpdateTransactionBody instance + */ + FileUpdateTransactionBody.create = function create(properties) { + return new FileUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified FileUpdateTransactionBody message. Does not implicitly {@link proto.FileUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.FileUpdateTransactionBody + * @static + * @param {proto.IFileUpdateTransactionBody} m FileUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(10).fork()).ldelim(); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.Timestamp.encode(m.expirationTime, w.uint32(18).fork()).ldelim(); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(26).fork()).ldelim(); + if (m.contents != null && Object.hasOwnProperty.call(m, "contents")) + w.uint32(34).bytes(m.contents); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(42).string(m.memo); + return w; + }; + + /** + * Decodes a FileUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.FileUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileUpdateTransactionBody} FileUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 2: { + m.expirationTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 4: { + m.contents = r.bytes(); + break; + } + case 5: { + m.memo = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.FileUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileUpdateTransactionBody"; + }; + + return FileUpdateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/freeze_transaction.d.ts b/packages/proto/src/minimal/freeze_transaction.d.ts new file mode 100644 index 0000000000..202f1652f8 --- /dev/null +++ b/packages/proto/src/minimal/freeze_transaction.d.ts @@ -0,0 +1,6415 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_freeze_transaction; + +declare namespace hashgraph_freeze_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for freeze. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The type of freeze. */ + enum FreezeType { + UNKNOWN_FREEZE_TYPE = 0, + FREEZE_ONLY = 1, + PREPARE_UPGRADE = 2, + FREEZE_UPGRADE = 3, + FREEZE_ABORT = 4, + TELEMETRY_UPGRADE = 5 + } + + /** Properties of a FreezeTransactionBody. */ + interface IFreezeTransactionBody { + + /** An upgrade file. */ + updateFile?: (proto.IFileID|null); + + /** A SHA384 hash of file content. */ + fileHash?: (Uint8Array|null); + + /** A start time for the freeze. */ + startTime?: (proto.ITimestamp|null); + + /** The type of freeze. */ + freezeType?: (proto.FreezeType|null); + } + + /** A transaction body for all freeze transactions. */ + class FreezeTransactionBody implements IFreezeTransactionBody { + + /** + * Constructs a new FreezeTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IFreezeTransactionBody); + + /** An upgrade file. */ + public updateFile?: (proto.IFileID|null); + + /** A SHA384 hash of file content. */ + public fileHash: Uint8Array; + + /** A start time for the freeze. */ + public startTime?: (proto.ITimestamp|null); + + /** The type of freeze. */ + public freezeType: proto.FreezeType; + + /** + * Creates a new FreezeTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns FreezeTransactionBody instance + */ + public static create(properties?: proto.IFreezeTransactionBody): proto.FreezeTransactionBody; + + /** + * Encodes the specified FreezeTransactionBody message. Does not implicitly {@link proto.FreezeTransactionBody.verify|verify} messages. + * @param m FreezeTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFreezeTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FreezeTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FreezeTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FreezeTransactionBody; + + /** + * Gets the default type url for FreezeTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Freeze the network. */ + freeze?: (proto.IFreezeTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for freeze. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Freeze the network. */ + public freeze?: (proto.IFreezeTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "freeze"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/freeze_transaction.js b/packages/proto/src/minimal/freeze_transaction.js new file mode 100644 index 0000000000..703af079e2 --- /dev/null +++ b/packages/proto/src/minimal/freeze_transaction.js @@ -0,0 +1,11184 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_freeze_transaction || ($protobuf.roots.hashgraph_freeze_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for freeze. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + /** + * The type of freeze. + * @name proto.FreezeType + * @enum {number} + * @property {number} UNKNOWN_FREEZE_TYPE=0 An (invalid) default value for this enum. + * @property {number} FREEZE_ONLY=1 Freezes the network at the specified time. + * @property {number} PREPARE_UPGRADE=2 Prepares the network for a software upgrade. + * @property {number} FREEZE_UPGRADE=3 Freezes the network and upgrades software. + * @property {number} FREEZE_ABORT=4 Aborts a pending network freeze. + * @property {number} TELEMETRY_UPGRADE=5 Upgrades telemetry. + */ + proto.FreezeType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_FREEZE_TYPE"] = 0; + values[valuesById[1] = "FREEZE_ONLY"] = 1; + values[valuesById[2] = "PREPARE_UPGRADE"] = 2; + values[valuesById[3] = "FREEZE_UPGRADE"] = 3; + values[valuesById[4] = "FREEZE_ABORT"] = 4; + values[valuesById[5] = "TELEMETRY_UPGRADE"] = 5; + return values; + })(); + + proto.FreezeTransactionBody = (function() { + + /** + * Properties of a FreezeTransactionBody. + * @memberof proto + * @interface IFreezeTransactionBody + * @property {proto.IFileID|null} [updateFile] An upgrade file. + * @property {Uint8Array|null} [fileHash] A SHA384 hash of file content. + * @property {proto.ITimestamp|null} [startTime] A start time for the freeze. + * @property {proto.FreezeType|null} [freezeType] The type of freeze. + */ + + /** + * Constructs a new FreezeTransactionBody. + * @memberof proto + * @classdesc A transaction body for all freeze transactions. + * @implements IFreezeTransactionBody + * @constructor + * @param {proto.IFreezeTransactionBody=} [p] Properties to set + */ + function FreezeTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An upgrade file. + * @member {proto.IFileID|null|undefined} updateFile + * @memberof proto.FreezeTransactionBody + * @instance + */ + FreezeTransactionBody.prototype.updateFile = null; + + /** + * A SHA384 hash of file content. + * @member {Uint8Array} fileHash + * @memberof proto.FreezeTransactionBody + * @instance + */ + FreezeTransactionBody.prototype.fileHash = $util.newBuffer([]); + + /** + * A start time for the freeze. + * @member {proto.ITimestamp|null|undefined} startTime + * @memberof proto.FreezeTransactionBody + * @instance + */ + FreezeTransactionBody.prototype.startTime = null; + + /** + * The type of freeze. + * @member {proto.FreezeType} freezeType + * @memberof proto.FreezeTransactionBody + * @instance + */ + FreezeTransactionBody.prototype.freezeType = 0; + + /** + * Creates a new FreezeTransactionBody instance using the specified properties. + * @function create + * @memberof proto.FreezeTransactionBody + * @static + * @param {proto.IFreezeTransactionBody=} [properties] Properties to set + * @returns {proto.FreezeTransactionBody} FreezeTransactionBody instance + */ + FreezeTransactionBody.create = function create(properties) { + return new FreezeTransactionBody(properties); + }; + + /** + * Encodes the specified FreezeTransactionBody message. Does not implicitly {@link proto.FreezeTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.FreezeTransactionBody + * @static + * @param {proto.IFreezeTransactionBody} m FreezeTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FreezeTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.updateFile != null && Object.hasOwnProperty.call(m, "updateFile")) + $root.proto.FileID.encode(m.updateFile, w.uint32(42).fork()).ldelim(); + if (m.fileHash != null && Object.hasOwnProperty.call(m, "fileHash")) + w.uint32(50).bytes(m.fileHash); + if (m.startTime != null && Object.hasOwnProperty.call(m, "startTime")) + $root.proto.Timestamp.encode(m.startTime, w.uint32(58).fork()).ldelim(); + if (m.freezeType != null && Object.hasOwnProperty.call(m, "freezeType")) + w.uint32(64).int32(m.freezeType); + return w; + }; + + /** + * Decodes a FreezeTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.FreezeTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FreezeTransactionBody} FreezeTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FreezeTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FreezeTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.updateFile = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 6: { + m.fileHash = r.bytes(); + break; + } + case 7: { + m.startTime = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 8: { + m.freezeType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FreezeTransactionBody + * @function getTypeUrl + * @memberof proto.FreezeTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FreezeTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FreezeTransactionBody"; + }; + + return FreezeTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IFreezeTransactionBody|null} [freeze] Freeze the network. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for freeze. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Freeze the network. + * @member {proto.IFreezeTransactionBody|null|undefined} freeze + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.freeze = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"freeze"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["freeze"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.freeze != null && Object.hasOwnProperty.call(m, "freeze")) + $root.proto.FreezeTransactionBody.encode(m.freeze, w.uint32(186).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 23: { + m.freeze = $root.proto.FreezeTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/node_create_transaction.d.ts b/packages/proto/src/minimal/node_create_transaction.d.ts new file mode 100644 index 0000000000..26af844594 --- /dev/null +++ b/packages/proto/src/minimal/node_create_transaction.d.ts @@ -0,0 +1,6435 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_node_create_transaction; + +declare namespace hashgraph_node_create_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for node create. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeCreateTransactionBody. */ + interface INodeCreateTransactionBody { + + /** A Node account identifier. */ + accountId?: (proto.IAccountID|null); + + /** A short description of the node. */ + description?: (string|null); + + /** A list of service endpoints for gossip. */ + gossipEndpoint?: (proto.IServiceEndpoint[]|null); + + /** A list of service endpoints for gRPC calls. */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** A certificate used to sign gossip events. */ + gossipCaCertificate?: (Uint8Array|null); + + /** A hash of the node gRPC TLS certificate. */ + grpcCertificateHash?: (Uint8Array|null); + + /** An administrative key controlled by the node operator. */ + adminKey?: (proto.IKey|null); + + /** A boolean flag indicating whether the node operator declines to receive node rewards. */ + declineReward?: (boolean|null); + + /** A web proxy for gRPC from non-gRPC clients. */ + grpcProxyEndpoint?: (proto.IServiceEndpoint|null); + } + + /** A transaction body to add a new consensus node to the network address book. */ + class NodeCreateTransactionBody implements INodeCreateTransactionBody { + + /** + * Constructs a new NodeCreateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeCreateTransactionBody); + + /** A Node account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** A short description of the node. */ + public description: string; + + /** A list of service endpoints for gossip. */ + public gossipEndpoint: proto.IServiceEndpoint[]; + + /** A list of service endpoints for gRPC calls. */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** A certificate used to sign gossip events. */ + public gossipCaCertificate: Uint8Array; + + /** A hash of the node gRPC TLS certificate. */ + public grpcCertificateHash: Uint8Array; + + /** An administrative key controlled by the node operator. */ + public adminKey?: (proto.IKey|null); + + /** A boolean flag indicating whether the node operator declines to receive node rewards. */ + public declineReward: boolean; + + /** A web proxy for gRPC from non-gRPC clients. */ + public grpcProxyEndpoint?: (proto.IServiceEndpoint|null); + + /** + * Creates a new NodeCreateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeCreateTransactionBody instance + */ + public static create(properties?: proto.INodeCreateTransactionBody): proto.NodeCreateTransactionBody; + + /** + * Encodes the specified NodeCreateTransactionBody message. Does not implicitly {@link proto.NodeCreateTransactionBody.verify|verify} messages. + * @param m NodeCreateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeCreateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeCreateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeCreateTransactionBody; + + /** + * Gets the default type url for NodeCreateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a new node in the network address book. */ + nodeCreate?: (proto.INodeCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for node create. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a new node in the network address book. */ + public nodeCreate?: (proto.INodeCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "nodeCreate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/node_create_transaction.js b/packages/proto/src/minimal/node_create_transaction.js new file mode 100644 index 0000000000..3c7fb93bcd --- /dev/null +++ b/packages/proto/src/minimal/node_create_transaction.js @@ -0,0 +1,11247 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_node_create_transaction || ($protobuf.roots.hashgraph_node_create_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for node create. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.NodeCreateTransactionBody = (function() { + + /** + * Properties of a NodeCreateTransactionBody. + * @memberof proto + * @interface INodeCreateTransactionBody + * @property {proto.IAccountID|null} [accountId] A Node account identifier. + * @property {string|null} [description] A short description of the node. + * @property {Array.|null} [gossipEndpoint] A list of service endpoints for gossip. + * @property {Array.|null} [serviceEndpoint] A list of service endpoints for gRPC calls. + * @property {Uint8Array|null} [gossipCaCertificate] A certificate used to sign gossip events. + * @property {Uint8Array|null} [grpcCertificateHash] A hash of the node gRPC TLS certificate. + * @property {proto.IKey|null} [adminKey] An administrative key controlled by the node operator. + * @property {boolean|null} [declineReward] A boolean flag indicating whether the node operator declines to receive node rewards. + * @property {proto.IServiceEndpoint|null} [grpcProxyEndpoint] A web proxy for gRPC from non-gRPC clients. + */ + + /** + * Constructs a new NodeCreateTransactionBody. + * @memberof proto + * @classdesc A transaction body to add a new consensus node to the network address book. + * @implements INodeCreateTransactionBody + * @constructor + * @param {proto.INodeCreateTransactionBody=} [p] Properties to set + */ + function NodeCreateTransactionBody(p) { + this.gossipEndpoint = []; + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Node account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.accountId = null; + + /** + * A short description of the node. + * @member {string} description + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.description = ""; + + /** + * A list of service endpoints for gossip. + * @member {Array.} gossipEndpoint + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.gossipEndpoint = $util.emptyArray; + + /** + * A list of service endpoints for gRPC calls. + * @member {Array.} serviceEndpoint + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A certificate used to sign gossip events. + * @member {Uint8Array} gossipCaCertificate + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.gossipCaCertificate = $util.newBuffer([]); + + /** + * A hash of the node gRPC TLS certificate. + * @member {Uint8Array} grpcCertificateHash + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.grpcCertificateHash = $util.newBuffer([]); + + /** + * An administrative key controlled by the node operator. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.adminKey = null; + + /** + * A boolean flag indicating whether the node operator declines to receive node rewards. + * @member {boolean} declineReward + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.declineReward = false; + + /** + * A web proxy for gRPC from non-gRPC clients. + * @member {proto.IServiceEndpoint|null|undefined} grpcProxyEndpoint + * @memberof proto.NodeCreateTransactionBody + * @instance + */ + NodeCreateTransactionBody.prototype.grpcProxyEndpoint = null; + + /** + * Creates a new NodeCreateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.NodeCreateTransactionBody + * @static + * @param {proto.INodeCreateTransactionBody=} [properties] Properties to set + * @returns {proto.NodeCreateTransactionBody} NodeCreateTransactionBody instance + */ + NodeCreateTransactionBody.create = function create(properties) { + return new NodeCreateTransactionBody(properties); + }; + + /** + * Encodes the specified NodeCreateTransactionBody message. Does not implicitly {@link proto.NodeCreateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.NodeCreateTransactionBody + * @static + * @param {proto.INodeCreateTransactionBody} m NodeCreateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeCreateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(18).string(m.description); + if (m.gossipEndpoint != null && m.gossipEndpoint.length) { + for (var i = 0; i < m.gossipEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.gossipEndpoint[i], w.uint32(26).fork()).ldelim(); + } + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(34).fork()).ldelim(); + } + if (m.gossipCaCertificate != null && Object.hasOwnProperty.call(m, "gossipCaCertificate")) + w.uint32(42).bytes(m.gossipCaCertificate); + if (m.grpcCertificateHash != null && Object.hasOwnProperty.call(m, "grpcCertificateHash")) + w.uint32(50).bytes(m.grpcCertificateHash); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(58).fork()).ldelim(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(64).bool(m.declineReward); + if (m.grpcProxyEndpoint != null && Object.hasOwnProperty.call(m, "grpcProxyEndpoint")) + $root.proto.ServiceEndpoint.encode(m.grpcProxyEndpoint, w.uint32(74).fork()).ldelim(); + return w; + }; + + /** + * Decodes a NodeCreateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeCreateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeCreateTransactionBody} NodeCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeCreateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeCreateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.description = r.string(); + break; + } + case 3: { + if (!(m.gossipEndpoint && m.gossipEndpoint.length)) + m.gossipEndpoint = []; + m.gossipEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 4: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 5: { + m.gossipCaCertificate = r.bytes(); + break; + } + case 6: { + m.grpcCertificateHash = r.bytes(); + break; + } + case 7: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.declineReward = r.bool(); + break; + } + case 9: { + m.grpcProxyEndpoint = $root.proto.ServiceEndpoint.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeCreateTransactionBody + * @function getTypeUrl + * @memberof proto.NodeCreateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeCreateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeCreateTransactionBody"; + }; + + return NodeCreateTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.INodeCreateTransactionBody|null} [nodeCreate] Create a new node in the network address book. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for node create. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a new node in the network address book. + * @member {proto.INodeCreateTransactionBody|null|undefined} nodeCreate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeCreate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"nodeCreate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["nodeCreate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.nodeCreate != null && Object.hasOwnProperty.call(m, "nodeCreate")) + $root.proto.NodeCreateTransactionBody.encode(m.nodeCreate, w.uint32(434).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 54: { + m.nodeCreate = $root.proto.NodeCreateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/node_delete_transaction.d.ts b/packages/proto/src/minimal/node_delete_transaction.d.ts new file mode 100644 index 0000000000..2779e1b2a6 --- /dev/null +++ b/packages/proto/src/minimal/node_delete_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_node_delete_transaction; + +declare namespace hashgraph_node_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for node delete. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeDeleteTransactionBody. */ + interface INodeDeleteTransactionBody { + + /** A consensus node identifier in the network state. */ + nodeId?: (Long|null); + } + + /** A transaction body to delete a node from the network address book. */ + class NodeDeleteTransactionBody implements INodeDeleteTransactionBody { + + /** + * Constructs a new NodeDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeDeleteTransactionBody); + + /** A consensus node identifier in the network state. */ + public nodeId: Long; + + /** + * Creates a new NodeDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeDeleteTransactionBody instance + */ + public static create(properties?: proto.INodeDeleteTransactionBody): proto.NodeDeleteTransactionBody; + + /** + * Encodes the specified NodeDeleteTransactionBody message. Does not implicitly {@link proto.NodeDeleteTransactionBody.verify|verify} messages. + * @param m NodeDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeDeleteTransactionBody; + + /** + * Gets the default type url for NodeDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a node from the network address book. */ + nodeDelete?: (proto.INodeDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for node delete. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a node from the network address book. */ + public nodeDelete?: (proto.INodeDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "nodeDelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/node_delete_transaction.js b/packages/proto/src/minimal/node_delete_transaction.js new file mode 100644 index 0000000000..46b0a9db59 --- /dev/null +++ b/packages/proto/src/minimal/node_delete_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_node_delete_transaction || ($protobuf.roots.hashgraph_node_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for node delete. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.NodeDeleteTransactionBody = (function() { + + /** + * Properties of a NodeDeleteTransactionBody. + * @memberof proto + * @interface INodeDeleteTransactionBody + * @property {Long|null} [nodeId] A consensus node identifier in the network state. + */ + + /** + * Constructs a new NodeDeleteTransactionBody. + * @memberof proto + * @classdesc A transaction body to delete a node from the network address book. + * @implements INodeDeleteTransactionBody + * @constructor + * @param {proto.INodeDeleteTransactionBody=} [p] Properties to set + */ + function NodeDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A consensus node identifier in the network state. + * @member {Long} nodeId + * @memberof proto.NodeDeleteTransactionBody + * @instance + */ + NodeDeleteTransactionBody.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new NodeDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.NodeDeleteTransactionBody + * @static + * @param {proto.INodeDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.NodeDeleteTransactionBody} NodeDeleteTransactionBody instance + */ + NodeDeleteTransactionBody.create = function create(properties) { + return new NodeDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified NodeDeleteTransactionBody message. Does not implicitly {@link proto.NodeDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.NodeDeleteTransactionBody + * @static + * @param {proto.INodeDeleteTransactionBody} m NodeDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(8).uint64(m.nodeId); + return w; + }; + + /** + * Decodes a NodeDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeDeleteTransactionBody} NodeDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodeId = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.NodeDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeDeleteTransactionBody"; + }; + + return NodeDeleteTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.INodeDeleteTransactionBody|null} [nodeDelete] Delete a node from the network address book. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for node delete. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a node from the network address book. + * @member {proto.INodeDeleteTransactionBody|null|undefined} nodeDelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeDelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"nodeDelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["nodeDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.nodeDelete != null && Object.hasOwnProperty.call(m, "nodeDelete")) + $root.proto.NodeDeleteTransactionBody.encode(m.nodeDelete, w.uint32(450).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 56: { + m.nodeDelete = $root.proto.NodeDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/node_stake_update_transaction.d.ts b/packages/proto/src/minimal/node_stake_update_transaction.d.ts new file mode 100644 index 0000000000..1100e7ed07 --- /dev/null +++ b/packages/proto/src/minimal/node_stake_update_transaction.d.ts @@ -0,0 +1,6547 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_node_stake_update_transaction; + +declare namespace hashgraph_node_stake_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for node stake update. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeStake. */ + interface INodeStake { + + /** A limit to the amount of stake considered for consensus weight. */ + maxStake?: (Long|null); + + /** A minimum amount of HBAR staked to a node to receive rewards. */ + minStake?: (Long|null); + + /** A node identifier. */ + nodeId?: (Long|null); + + /** The rate of rewards, in tinybar per HBAR. */ + rewardRate?: (Long|null); + + /** A consensus weight assigned to this node for the next staking period. */ + stake?: (Long|null); + + /** The total amount staked to this node, while declining rewards. */ + stakeNotRewarded?: (Long|null); + + /** The total amount staked to this node, while accepting rewards. */ + stakeRewarded?: (Long|null); + } + + /** Staking information for one node at the end of a staking period. */ + class NodeStake implements INodeStake { + + /** + * Constructs a new NodeStake. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeStake); + + /** A limit to the amount of stake considered for consensus weight. */ + public maxStake: Long; + + /** A minimum amount of HBAR staked to a node to receive rewards. */ + public minStake: Long; + + /** A node identifier. */ + public nodeId: Long; + + /** The rate of rewards, in tinybar per HBAR. */ + public rewardRate: Long; + + /** A consensus weight assigned to this node for the next staking period. */ + public stake: Long; + + /** The total amount staked to this node, while declining rewards. */ + public stakeNotRewarded: Long; + + /** The total amount staked to this node, while accepting rewards. */ + public stakeRewarded: Long; + + /** + * Creates a new NodeStake instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeStake instance + */ + public static create(properties?: proto.INodeStake): proto.NodeStake; + + /** + * Encodes the specified NodeStake message. Does not implicitly {@link proto.NodeStake.verify|verify} messages. + * @param m NodeStake message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeStake, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeStake message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeStake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeStake; + + /** + * Gets the default type url for NodeStake + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeStakeUpdateTransactionBody. */ + interface INodeStakeUpdateTransactionBody { + + /** A timestamp indicating the end of the staking period. */ + endOfStakingPeriod?: (proto.ITimestamp|null); + + /** A list of NodeStake entries for each node. */ + nodeStake?: (proto.INodeStake[]|null); + + /** A maximum reward rate for this staking period. */ + maxStakingRewardRatePerHbar?: (Long|null); + + /** A fraction of network and service fees paid to the node reward account. */ + nodeRewardFeeFraction?: (proto.IFraction|null); + + /** A limit to the number of staking periods held for inactive accounts. */ + stakingPeriodsStored?: (Long|null); + + /** A number of minutes representing a staking period. */ + stakingPeriod?: (Long|null); + + /** A fraction of network and service fees paid to the general reward account. */ + stakingRewardFeeFraction?: (proto.IFraction|null); + + /** A minimum balance required to pay general staking rewards. */ + stakingStartThreshold?: (Long|null); + + /** An amount reserved in the staking reward account. */ + reservedStakingRewards?: (Long|null); + + /** An available, unreserved, amount in the staking reward account. */ + unreservedStakingRewardBalance?: (Long|null); + + /** A minimum balance required for maximum staking rewards. */ + rewardBalanceThreshold?: (Long|null); + + /** A maximum network-wide stake that can earn full rewards. */ + maxStakeRewarded?: (Long|null); + + /** A limit amount that could be paid as staking rewards. */ + maxTotalReward?: (Long|null); + } + + /** A system initiated transaction to update staking information. */ + class NodeStakeUpdateTransactionBody implements INodeStakeUpdateTransactionBody { + + /** + * Constructs a new NodeStakeUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeStakeUpdateTransactionBody); + + /** A timestamp indicating the end of the staking period. */ + public endOfStakingPeriod?: (proto.ITimestamp|null); + + /** A list of NodeStake entries for each node. */ + public nodeStake: proto.INodeStake[]; + + /** A maximum reward rate for this staking period. */ + public maxStakingRewardRatePerHbar: Long; + + /** A fraction of network and service fees paid to the node reward account. */ + public nodeRewardFeeFraction?: (proto.IFraction|null); + + /** A limit to the number of staking periods held for inactive accounts. */ + public stakingPeriodsStored: Long; + + /** A number of minutes representing a staking period. */ + public stakingPeriod: Long; + + /** A fraction of network and service fees paid to the general reward account. */ + public stakingRewardFeeFraction?: (proto.IFraction|null); + + /** A minimum balance required to pay general staking rewards. */ + public stakingStartThreshold: Long; + + /** An amount reserved in the staking reward account. */ + public reservedStakingRewards: Long; + + /** An available, unreserved, amount in the staking reward account. */ + public unreservedStakingRewardBalance: Long; + + /** A minimum balance required for maximum staking rewards. */ + public rewardBalanceThreshold: Long; + + /** A maximum network-wide stake that can earn full rewards. */ + public maxStakeRewarded: Long; + + /** A limit amount that could be paid as staking rewards. */ + public maxTotalReward: Long; + + /** + * Creates a new NodeStakeUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeStakeUpdateTransactionBody instance + */ + public static create(properties?: proto.INodeStakeUpdateTransactionBody): proto.NodeStakeUpdateTransactionBody; + + /** + * Encodes the specified NodeStakeUpdateTransactionBody message. Does not implicitly {@link proto.NodeStakeUpdateTransactionBody.verify|verify} messages. + * @param m NodeStakeUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeStakeUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeStakeUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeStakeUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeStakeUpdateTransactionBody; + + /** + * Gets the default type url for NodeStakeUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update the staking information. */ + nodeStakeUpdate?: (proto.INodeStakeUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for node stake update. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update the staking information. */ + public nodeStakeUpdate?: (proto.INodeStakeUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "nodeStakeUpdate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/node_stake_update_transaction.js b/packages/proto/src/minimal/node_stake_update_transaction.js new file mode 100644 index 0000000000..8338b44f65 --- /dev/null +++ b/packages/proto/src/minimal/node_stake_update_transaction.js @@ -0,0 +1,11501 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_node_stake_update_transaction || ($protobuf.roots.hashgraph_node_stake_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for node stake update. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.NodeStake = (function() { + + /** + * Properties of a NodeStake. + * @memberof proto + * @interface INodeStake + * @property {Long|null} [maxStake] A limit to the amount of stake considered for consensus weight. + * @property {Long|null} [minStake] A minimum amount of HBAR staked to a node to receive rewards. + * @property {Long|null} [nodeId] A node identifier. + * @property {Long|null} [rewardRate] The rate of rewards, in tinybar per HBAR. + * @property {Long|null} [stake] A consensus weight assigned to this node for the next staking period. + * @property {Long|null} [stakeNotRewarded] The total amount staked to this node, while declining rewards. + * @property {Long|null} [stakeRewarded] The total amount staked to this node, while accepting rewards. + */ + + /** + * Constructs a new NodeStake. + * @memberof proto + * @classdesc Staking information for one node at the end of a staking period. + * @implements INodeStake + * @constructor + * @param {proto.INodeStake=} [p] Properties to set + */ + function NodeStake(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A limit to the amount of stake considered for consensus weight. + * @member {Long} maxStake + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.maxStake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A minimum amount of HBAR staked to a node to receive rewards. + * @member {Long} minStake + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.minStake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A node identifier. + * @member {Long} nodeId + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The rate of rewards, in tinybar per HBAR. + * @member {Long} rewardRate + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.rewardRate = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A consensus weight assigned to this node for the next staking period. + * @member {Long} stake + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The total amount staked to this node, while declining rewards. + * @member {Long} stakeNotRewarded + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.stakeNotRewarded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The total amount staked to this node, while accepting rewards. + * @member {Long} stakeRewarded + * @memberof proto.NodeStake + * @instance + */ + NodeStake.prototype.stakeRewarded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeStake instance using the specified properties. + * @function create + * @memberof proto.NodeStake + * @static + * @param {proto.INodeStake=} [properties] Properties to set + * @returns {proto.NodeStake} NodeStake instance + */ + NodeStake.create = function create(properties) { + return new NodeStake(properties); + }; + + /** + * Encodes the specified NodeStake message. Does not implicitly {@link proto.NodeStake.verify|verify} messages. + * @function encode + * @memberof proto.NodeStake + * @static + * @param {proto.INodeStake} m NodeStake message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeStake.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.maxStake != null && Object.hasOwnProperty.call(m, "maxStake")) + w.uint32(8).int64(m.maxStake); + if (m.minStake != null && Object.hasOwnProperty.call(m, "minStake")) + w.uint32(16).int64(m.minStake); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(24).int64(m.nodeId); + if (m.rewardRate != null && Object.hasOwnProperty.call(m, "rewardRate")) + w.uint32(32).int64(m.rewardRate); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(40).int64(m.stake); + if (m.stakeNotRewarded != null && Object.hasOwnProperty.call(m, "stakeNotRewarded")) + w.uint32(48).int64(m.stakeNotRewarded); + if (m.stakeRewarded != null && Object.hasOwnProperty.call(m, "stakeRewarded")) + w.uint32(56).int64(m.stakeRewarded); + return w; + }; + + /** + * Decodes a NodeStake message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeStake + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeStake} NodeStake + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeStake.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeStake(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.maxStake = r.int64(); + break; + } + case 2: { + m.minStake = r.int64(); + break; + } + case 3: { + m.nodeId = r.int64(); + break; + } + case 4: { + m.rewardRate = r.int64(); + break; + } + case 5: { + m.stake = r.int64(); + break; + } + case 6: { + m.stakeNotRewarded = r.int64(); + break; + } + case 7: { + m.stakeRewarded = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeStake + * @function getTypeUrl + * @memberof proto.NodeStake + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeStake.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeStake"; + }; + + return NodeStake; + })(); + + proto.NodeStakeUpdateTransactionBody = (function() { + + /** + * Properties of a NodeStakeUpdateTransactionBody. + * @memberof proto + * @interface INodeStakeUpdateTransactionBody + * @property {proto.ITimestamp|null} [endOfStakingPeriod] A timestamp indicating the end of the staking period. + * @property {Array.|null} [nodeStake] A list of NodeStake entries for each node. + * @property {Long|null} [maxStakingRewardRatePerHbar] A maximum reward rate for this staking period. + * @property {proto.IFraction|null} [nodeRewardFeeFraction] A fraction of network and service fees paid to the node reward account. + * @property {Long|null} [stakingPeriodsStored] A limit to the number of staking periods held for inactive accounts. + * @property {Long|null} [stakingPeriod] A number of minutes representing a staking period. + * @property {proto.IFraction|null} [stakingRewardFeeFraction] A fraction of network and service fees paid to the general reward account. + * @property {Long|null} [stakingStartThreshold] A minimum balance required to pay general staking rewards. + * @property {Long|null} [reservedStakingRewards] An amount reserved in the staking reward account. + * @property {Long|null} [unreservedStakingRewardBalance] An available, unreserved, amount in the staking reward account. + * @property {Long|null} [rewardBalanceThreshold] A minimum balance required for maximum staking rewards. + * @property {Long|null} [maxStakeRewarded] A maximum network-wide stake that can earn full rewards. + * @property {Long|null} [maxTotalReward] A limit amount that could be paid as staking rewards. + */ + + /** + * Constructs a new NodeStakeUpdateTransactionBody. + * @memberof proto + * @classdesc A system initiated transaction to update staking information. + * @implements INodeStakeUpdateTransactionBody + * @constructor + * @param {proto.INodeStakeUpdateTransactionBody=} [p] Properties to set + */ + function NodeStakeUpdateTransactionBody(p) { + this.nodeStake = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp indicating the end of the staking period. + * @member {proto.ITimestamp|null|undefined} endOfStakingPeriod + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.endOfStakingPeriod = null; + + /** + * A list of NodeStake entries for each node. + * @member {Array.} nodeStake + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.nodeStake = $util.emptyArray; + + /** + * A maximum reward rate for this staking period. + * @member {Long} maxStakingRewardRatePerHbar + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.maxStakingRewardRatePerHbar = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fraction of network and service fees paid to the node reward account. + * @member {proto.IFraction|null|undefined} nodeRewardFeeFraction + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.nodeRewardFeeFraction = null; + + /** + * A limit to the number of staking periods held for inactive accounts. + * @member {Long} stakingPeriodsStored + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.stakingPeriodsStored = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A number of minutes representing a staking period. + * @member {Long} stakingPeriod + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.stakingPeriod = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fraction of network and service fees paid to the general reward account. + * @member {proto.IFraction|null|undefined} stakingRewardFeeFraction + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.stakingRewardFeeFraction = null; + + /** + * A minimum balance required to pay general staking rewards. + * @member {Long} stakingStartThreshold + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.stakingStartThreshold = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An amount reserved in the staking reward account. + * @member {Long} reservedStakingRewards + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.reservedStakingRewards = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An available, unreserved, amount in the staking reward account. + * @member {Long} unreservedStakingRewardBalance + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.unreservedStakingRewardBalance = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A minimum balance required for maximum staking rewards. + * @member {Long} rewardBalanceThreshold + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.rewardBalanceThreshold = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum network-wide stake that can earn full rewards. + * @member {Long} maxStakeRewarded + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.maxStakeRewarded = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A limit amount that could be paid as staking rewards. + * @member {Long} maxTotalReward + * @memberof proto.NodeStakeUpdateTransactionBody + * @instance + */ + NodeStakeUpdateTransactionBody.prototype.maxTotalReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeStakeUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.NodeStakeUpdateTransactionBody + * @static + * @param {proto.INodeStakeUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.NodeStakeUpdateTransactionBody} NodeStakeUpdateTransactionBody instance + */ + NodeStakeUpdateTransactionBody.create = function create(properties) { + return new NodeStakeUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified NodeStakeUpdateTransactionBody message. Does not implicitly {@link proto.NodeStakeUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.NodeStakeUpdateTransactionBody + * @static + * @param {proto.INodeStakeUpdateTransactionBody} m NodeStakeUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeStakeUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.endOfStakingPeriod != null && Object.hasOwnProperty.call(m, "endOfStakingPeriod")) + $root.proto.Timestamp.encode(m.endOfStakingPeriod, w.uint32(10).fork()).ldelim(); + if (m.nodeStake != null && m.nodeStake.length) { + for (var i = 0; i < m.nodeStake.length; ++i) + $root.proto.NodeStake.encode(m.nodeStake[i], w.uint32(18).fork()).ldelim(); + } + if (m.maxStakingRewardRatePerHbar != null && Object.hasOwnProperty.call(m, "maxStakingRewardRatePerHbar")) + w.uint32(24).int64(m.maxStakingRewardRatePerHbar); + if (m.nodeRewardFeeFraction != null && Object.hasOwnProperty.call(m, "nodeRewardFeeFraction")) + $root.proto.Fraction.encode(m.nodeRewardFeeFraction, w.uint32(34).fork()).ldelim(); + if (m.stakingPeriodsStored != null && Object.hasOwnProperty.call(m, "stakingPeriodsStored")) + w.uint32(40).int64(m.stakingPeriodsStored); + if (m.stakingPeriod != null && Object.hasOwnProperty.call(m, "stakingPeriod")) + w.uint32(48).int64(m.stakingPeriod); + if (m.stakingRewardFeeFraction != null && Object.hasOwnProperty.call(m, "stakingRewardFeeFraction")) + $root.proto.Fraction.encode(m.stakingRewardFeeFraction, w.uint32(58).fork()).ldelim(); + if (m.stakingStartThreshold != null && Object.hasOwnProperty.call(m, "stakingStartThreshold")) + w.uint32(64).int64(m.stakingStartThreshold); + if (m.reservedStakingRewards != null && Object.hasOwnProperty.call(m, "reservedStakingRewards")) + w.uint32(80).int64(m.reservedStakingRewards); + if (m.unreservedStakingRewardBalance != null && Object.hasOwnProperty.call(m, "unreservedStakingRewardBalance")) + w.uint32(88).int64(m.unreservedStakingRewardBalance); + if (m.rewardBalanceThreshold != null && Object.hasOwnProperty.call(m, "rewardBalanceThreshold")) + w.uint32(96).int64(m.rewardBalanceThreshold); + if (m.maxStakeRewarded != null && Object.hasOwnProperty.call(m, "maxStakeRewarded")) + w.uint32(104).int64(m.maxStakeRewarded); + if (m.maxTotalReward != null && Object.hasOwnProperty.call(m, "maxTotalReward")) + w.uint32(112).int64(m.maxTotalReward); + return w; + }; + + /** + * Decodes a NodeStakeUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeStakeUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeStakeUpdateTransactionBody} NodeStakeUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeStakeUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeStakeUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.endOfStakingPeriod = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.nodeStake && m.nodeStake.length)) + m.nodeStake = []; + m.nodeStake.push($root.proto.NodeStake.decode(r, r.uint32())); + break; + } + case 3: { + m.maxStakingRewardRatePerHbar = r.int64(); + break; + } + case 4: { + m.nodeRewardFeeFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 5: { + m.stakingPeriodsStored = r.int64(); + break; + } + case 6: { + m.stakingPeriod = r.int64(); + break; + } + case 7: { + m.stakingRewardFeeFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 8: { + m.stakingStartThreshold = r.int64(); + break; + } + case 10: { + m.reservedStakingRewards = r.int64(); + break; + } + case 11: { + m.unreservedStakingRewardBalance = r.int64(); + break; + } + case 12: { + m.rewardBalanceThreshold = r.int64(); + break; + } + case 13: { + m.maxStakeRewarded = r.int64(); + break; + } + case 14: { + m.maxTotalReward = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeStakeUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.NodeStakeUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeStakeUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeStakeUpdateTransactionBody"; + }; + + return NodeStakeUpdateTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.INodeStakeUpdateTransactionBody|null} [nodeStakeUpdate] Update the staking information. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for node stake update. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update the staking information. + * @member {proto.INodeStakeUpdateTransactionBody|null|undefined} nodeStakeUpdate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeStakeUpdate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"nodeStakeUpdate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["nodeStakeUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.nodeStakeUpdate != null && Object.hasOwnProperty.call(m, "nodeStakeUpdate")) + $root.proto.NodeStakeUpdateTransactionBody.encode(m.nodeStakeUpdate, w.uint32(410).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 51: { + m.nodeStakeUpdate = $root.proto.NodeStakeUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/node_update_transaction.d.ts b/packages/proto/src/minimal/node_update_transaction.d.ts new file mode 100644 index 0000000000..e9949ee404 --- /dev/null +++ b/packages/proto/src/minimal/node_update_transaction.d.ts @@ -0,0 +1,6545 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_node_update_transaction; + +declare namespace hashgraph_node_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for node update. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** A wrapper for optional string values. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: proto.IStringValue): proto.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link proto.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The boolean value. */ + value?: (boolean|null); + } + + /** A wrapper for optional boolean values. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IBoolValue); + + /** The boolean value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: proto.IBoolValue): proto.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link proto.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeUpdateTransactionBody. */ + interface INodeUpdateTransactionBody { + + /** A consensus node identifier in the network state. */ + nodeId?: (Long|null); + + /** An account identifier. */ + accountId?: (proto.IAccountID|null); + + /** A short description of the node. */ + description?: (proto.IStringValue|null); + + /** A list of service endpoints for gossip. */ + gossipEndpoint?: (proto.IServiceEndpoint[]|null); + + /** A list of service endpoints for gRPC calls. */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** A certificate used to sign gossip events. */ + gossipCaCertificate?: (google.protobuf.IBytesValue|null); + + /** A hash of the node gRPC TLS certificate. */ + grpcCertificateHash?: (google.protobuf.IBytesValue|null); + + /** An administrative key controlled by the node operator. */ + adminKey?: (proto.IKey|null); + + /** A boolean indicating that this node has chosen to decline node rewards. */ + declineReward?: (proto.IBoolValue|null); + + /** A web proxy for gRPC from non-gRPC clients. */ + grpcProxyEndpoint?: (proto.IServiceEndpoint|null); + } + + /** Transaction body to modify address book node attributes. */ + class NodeUpdateTransactionBody implements INodeUpdateTransactionBody { + + /** + * Constructs a new NodeUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeUpdateTransactionBody); + + /** A consensus node identifier in the network state. */ + public nodeId: Long; + + /** An account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** A short description of the node. */ + public description?: (proto.IStringValue|null); + + /** A list of service endpoints for gossip. */ + public gossipEndpoint: proto.IServiceEndpoint[]; + + /** A list of service endpoints for gRPC calls. */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** A certificate used to sign gossip events. */ + public gossipCaCertificate?: (google.protobuf.IBytesValue|null); + + /** A hash of the node gRPC TLS certificate. */ + public grpcCertificateHash?: (google.protobuf.IBytesValue|null); + + /** An administrative key controlled by the node operator. */ + public adminKey?: (proto.IKey|null); + + /** A boolean indicating that this node has chosen to decline node rewards. */ + public declineReward?: (proto.IBoolValue|null); + + /** A web proxy for gRPC from non-gRPC clients. */ + public grpcProxyEndpoint?: (proto.IServiceEndpoint|null); + + /** + * Creates a new NodeUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeUpdateTransactionBody instance + */ + public static create(properties?: proto.INodeUpdateTransactionBody): proto.NodeUpdateTransactionBody; + + /** + * Encodes the specified NodeUpdateTransactionBody message. Does not implicitly {@link proto.NodeUpdateTransactionBody.verify|verify} messages. + * @param m NodeUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeUpdateTransactionBody; + + /** + * Gets the default type url for NodeUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update a node in the network address book. */ + nodeUpdate?: (proto.INodeUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for node update. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update a node in the network address book. */ + public nodeUpdate?: (proto.INodeUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "nodeUpdate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/node_update_transaction.js b/packages/proto/src/minimal/node_update_transaction.js new file mode 100644 index 0000000000..a885102110 --- /dev/null +++ b/packages/proto/src/minimal/node_update_transaction.js @@ -0,0 +1,11480 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_node_update_transaction || ($protobuf.roots.hashgraph_node_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for node update. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof proto + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof proto + * @classdesc A wrapper for optional string values. + * @implements IStringValue + * @constructor + * @param {proto.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof proto.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof proto.StringValue + * @static + * @param {proto.IStringValue=} [properties] Properties to set + * @returns {proto.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link proto.StringValue.verify|verify} messages. + * @function encode + * @memberof proto.StringValue + * @static + * @param {proto.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof proto.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof proto.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StringValue"; + }; + + return StringValue; + })(); + + proto.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof proto + * @interface IBoolValue + * @property {boolean|null} [value] The boolean value. + */ + + /** + * Constructs a new BoolValue. + * @memberof proto + * @classdesc A wrapper for optional boolean values. + * @implements IBoolValue + * @constructor + * @param {proto.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The boolean value. + * @member {boolean} value + * @memberof proto.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof proto.BoolValue + * @static + * @param {proto.IBoolValue=} [properties] Properties to set + * @returns {proto.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link proto.BoolValue.verify|verify} messages. + * @function encode + * @memberof proto.BoolValue + * @static + * @param {proto.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof proto.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof proto.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.BoolValue"; + }; + + return BoolValue; + })(); + + proto.NodeUpdateTransactionBody = (function() { + + /** + * Properties of a NodeUpdateTransactionBody. + * @memberof proto + * @interface INodeUpdateTransactionBody + * @property {Long|null} [nodeId] A consensus node identifier in the network state. + * @property {proto.IAccountID|null} [accountId] An account identifier. + * @property {proto.IStringValue|null} [description] A short description of the node. + * @property {Array.|null} [gossipEndpoint] A list of service endpoints for gossip. + * @property {Array.|null} [serviceEndpoint] A list of service endpoints for gRPC calls. + * @property {google.protobuf.IBytesValue|null} [gossipCaCertificate] A certificate used to sign gossip events. + * @property {google.protobuf.IBytesValue|null} [grpcCertificateHash] A hash of the node gRPC TLS certificate. + * @property {proto.IKey|null} [adminKey] An administrative key controlled by the node operator. + * @property {proto.IBoolValue|null} [declineReward] A boolean indicating that this node has chosen to decline node rewards. + * @property {proto.IServiceEndpoint|null} [grpcProxyEndpoint] A web proxy for gRPC from non-gRPC clients. + */ + + /** + * Constructs a new NodeUpdateTransactionBody. + * @memberof proto + * @classdesc Transaction body to modify address book node attributes. + * @implements INodeUpdateTransactionBody + * @constructor + * @param {proto.INodeUpdateTransactionBody=} [p] Properties to set + */ + function NodeUpdateTransactionBody(p) { + this.gossipEndpoint = []; + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A consensus node identifier in the network state. + * @member {Long} nodeId + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * An account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.accountId = null; + + /** + * A short description of the node. + * @member {proto.IStringValue|null|undefined} description + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.description = null; + + /** + * A list of service endpoints for gossip. + * @member {Array.} gossipEndpoint + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.gossipEndpoint = $util.emptyArray; + + /** + * A list of service endpoints for gRPC calls. + * @member {Array.} serviceEndpoint + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A certificate used to sign gossip events. + * @member {google.protobuf.IBytesValue|null|undefined} gossipCaCertificate + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.gossipCaCertificate = null; + + /** + * A hash of the node gRPC TLS certificate. + * @member {google.protobuf.IBytesValue|null|undefined} grpcCertificateHash + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.grpcCertificateHash = null; + + /** + * An administrative key controlled by the node operator. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.adminKey = null; + + /** + * A boolean indicating that this node has chosen to decline node rewards. + * @member {proto.IBoolValue|null|undefined} declineReward + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.declineReward = null; + + /** + * A web proxy for gRPC from non-gRPC clients. + * @member {proto.IServiceEndpoint|null|undefined} grpcProxyEndpoint + * @memberof proto.NodeUpdateTransactionBody + * @instance + */ + NodeUpdateTransactionBody.prototype.grpcProxyEndpoint = null; + + /** + * Creates a new NodeUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.NodeUpdateTransactionBody + * @static + * @param {proto.INodeUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.NodeUpdateTransactionBody} NodeUpdateTransactionBody instance + */ + NodeUpdateTransactionBody.create = function create(properties) { + return new NodeUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified NodeUpdateTransactionBody message. Does not implicitly {@link proto.NodeUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.NodeUpdateTransactionBody + * @static + * @param {proto.INodeUpdateTransactionBody} m NodeUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(8).uint64(m.nodeId); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + $root.proto.StringValue.encode(m.description, w.uint32(26).fork()).ldelim(); + if (m.gossipEndpoint != null && m.gossipEndpoint.length) { + for (var i = 0; i < m.gossipEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.gossipEndpoint[i], w.uint32(34).fork()).ldelim(); + } + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(42).fork()).ldelim(); + } + if (m.gossipCaCertificate != null && Object.hasOwnProperty.call(m, "gossipCaCertificate")) + $root.google.protobuf.BytesValue.encode(m.gossipCaCertificate, w.uint32(50).fork()).ldelim(); + if (m.grpcCertificateHash != null && Object.hasOwnProperty.call(m, "grpcCertificateHash")) + $root.google.protobuf.BytesValue.encode(m.grpcCertificateHash, w.uint32(58).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(66).fork()).ldelim(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + $root.proto.BoolValue.encode(m.declineReward, w.uint32(74).fork()).ldelim(); + if (m.grpcProxyEndpoint != null && Object.hasOwnProperty.call(m, "grpcProxyEndpoint")) + $root.proto.ServiceEndpoint.encode(m.grpcProxyEndpoint, w.uint32(82).fork()).ldelim(); + return w; + }; + + /** + * Decodes a NodeUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeUpdateTransactionBody} NodeUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodeId = r.uint64(); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.description = $root.proto.StringValue.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.gossipEndpoint && m.gossipEndpoint.length)) + m.gossipEndpoint = []; + m.gossipEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 5: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 6: { + m.gossipCaCertificate = $root.google.protobuf.BytesValue.decode(r, r.uint32()); + break; + } + case 7: { + m.grpcCertificateHash = $root.google.protobuf.BytesValue.decode(r, r.uint32()); + break; + } + case 8: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 9: { + m.declineReward = $root.proto.BoolValue.decode(r, r.uint32()); + break; + } + case 10: { + m.grpcProxyEndpoint = $root.proto.ServiceEndpoint.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.NodeUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeUpdateTransactionBody"; + }; + + return NodeUpdateTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.INodeUpdateTransactionBody|null} [nodeUpdate] Update a node in the network address book. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for node update. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update a node in the network address book. + * @member {proto.INodeUpdateTransactionBody|null|undefined} nodeUpdate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeUpdate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"nodeUpdate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["nodeUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.nodeUpdate != null && Object.hasOwnProperty.call(m, "nodeUpdate")) + $root.proto.NodeUpdateTransactionBody.encode(m.nodeUpdate, w.uint32(442).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 55: { + m.nodeUpdate = $root.proto.NodeUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/schedule_delete_transaction.d.ts b/packages/proto/src/minimal/schedule_delete_transaction.d.ts new file mode 100644 index 0000000000..d98884ab4d --- /dev/null +++ b/packages/proto/src/minimal/schedule_delete_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_schedule_delete_transaction; + +declare namespace hashgraph_schedule_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for schedule deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a schedule. */ + scheduleDelete?: (proto.IScheduleDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for schedule deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a schedule. */ + public scheduleDelete?: (proto.IScheduleDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "scheduleDelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleDeleteTransactionBody. */ + interface IScheduleDeleteTransactionBody { + + /** The ID of the Scheduled Entity to be deleted. */ + scheduleID?: (proto.IScheduleID|null); + } + + /** Marks a schedule in the network's action queue as deleted, preventing it from executing. */ + class ScheduleDeleteTransactionBody implements IScheduleDeleteTransactionBody { + + /** + * Constructs a new ScheduleDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleDeleteTransactionBody); + + /** The ID of the Scheduled Entity to be deleted. */ + public scheduleID?: (proto.IScheduleID|null); + + /** + * Creates a new ScheduleDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleDeleteTransactionBody instance + */ + public static create(properties?: proto.IScheduleDeleteTransactionBody): proto.ScheduleDeleteTransactionBody; + + /** + * Encodes the specified ScheduleDeleteTransactionBody message. Does not implicitly {@link proto.ScheduleDeleteTransactionBody.verify|verify} messages. + * @param m ScheduleDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleDeleteTransactionBody; + + /** + * Gets the default type url for ScheduleDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/schedule_delete_transaction.js b/packages/proto/src/minimal/schedule_delete_transaction.js new file mode 100644 index 0000000000..d7fb89946c --- /dev/null +++ b/packages/proto/src/minimal/schedule_delete_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_schedule_delete_transaction || ($protobuf.roots.hashgraph_schedule_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for schedule deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IScheduleDeleteTransactionBody|null} [scheduleDelete] Delete a schedule. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for schedule deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a schedule. + * @member {proto.IScheduleDeleteTransactionBody|null|undefined} scheduleDelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.scheduleDelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"scheduleDelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["scheduleDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.scheduleDelete != null && Object.hasOwnProperty.call(m, "scheduleDelete")) + $root.proto.ScheduleDeleteTransactionBody.encode(m.scheduleDelete, w.uint32(274).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 34: { + m.scheduleDelete = $root.proto.ScheduleDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ScheduleDeleteTransactionBody = (function() { + + /** + * Properties of a ScheduleDeleteTransactionBody. + * @memberof proto + * @interface IScheduleDeleteTransactionBody + * @property {proto.IScheduleID|null} [scheduleID] The ID of the Scheduled Entity to be deleted. + */ + + /** + * Constructs a new ScheduleDeleteTransactionBody. + * @memberof proto + * @classdesc Marks a schedule in the network's action queue as deleted, preventing it from executing. + * @implements IScheduleDeleteTransactionBody + * @constructor + * @param {proto.IScheduleDeleteTransactionBody=} [p] Properties to set + */ + function ScheduleDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The ID of the Scheduled Entity to be deleted. + * @member {proto.IScheduleID|null|undefined} scheduleID + * @memberof proto.ScheduleDeleteTransactionBody + * @instance + */ + ScheduleDeleteTransactionBody.prototype.scheduleID = null; + + /** + * Creates a new ScheduleDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ScheduleDeleteTransactionBody + * @static + * @param {proto.IScheduleDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.ScheduleDeleteTransactionBody} ScheduleDeleteTransactionBody instance + */ + ScheduleDeleteTransactionBody.create = function create(properties) { + return new ScheduleDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified ScheduleDeleteTransactionBody message. Does not implicitly {@link proto.ScheduleDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleDeleteTransactionBody + * @static + * @param {proto.IScheduleDeleteTransactionBody} m ScheduleDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.scheduleID != null && Object.hasOwnProperty.call(m, "scheduleID")) + $root.proto.ScheduleID.encode(m.scheduleID, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ScheduleDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleDeleteTransactionBody} ScheduleDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.scheduleID = $root.proto.ScheduleID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.ScheduleDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleDeleteTransactionBody"; + }; + + return ScheduleDeleteTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/schedule_sign_transaction.d.ts b/packages/proto/src/minimal/schedule_sign_transaction.d.ts new file mode 100644 index 0000000000..d3cc969008 --- /dev/null +++ b/packages/proto/src/minimal/schedule_sign_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_schedule_sign_transaction; + +declare namespace hashgraph_schedule_sign_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for schedule sign. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleSignTransactionBody. */ + interface IScheduleSignTransactionBody { + + /** A schedule identifier. */ + scheduleID?: (proto.IScheduleID|null); + } + + /** Add signatures to an existing scheduled transaction. */ + class ScheduleSignTransactionBody implements IScheduleSignTransactionBody { + + /** + * Constructs a new ScheduleSignTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleSignTransactionBody); + + /** A schedule identifier. */ + public scheduleID?: (proto.IScheduleID|null); + + /** + * Creates a new ScheduleSignTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleSignTransactionBody instance + */ + public static create(properties?: proto.IScheduleSignTransactionBody): proto.ScheduleSignTransactionBody; + + /** + * Encodes the specified ScheduleSignTransactionBody message. Does not implicitly {@link proto.ScheduleSignTransactionBody.verify|verify} messages. + * @param m ScheduleSignTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleSignTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleSignTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleSignTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleSignTransactionBody; + + /** + * Gets the default type url for ScheduleSignTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Sign a schedule. */ + scheduleSign?: (proto.IScheduleSignTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for schedule sign. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Sign a schedule. */ + public scheduleSign?: (proto.IScheduleSignTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "scheduleSign"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/schedule_sign_transaction.js b/packages/proto/src/minimal/schedule_sign_transaction.js new file mode 100644 index 0000000000..e97a18d511 --- /dev/null +++ b/packages/proto/src/minimal/schedule_sign_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_schedule_sign_transaction || ($protobuf.roots.hashgraph_schedule_sign_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for schedule sign. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.ScheduleSignTransactionBody = (function() { + + /** + * Properties of a ScheduleSignTransactionBody. + * @memberof proto + * @interface IScheduleSignTransactionBody + * @property {proto.IScheduleID|null} [scheduleID] A schedule identifier. + */ + + /** + * Constructs a new ScheduleSignTransactionBody. + * @memberof proto + * @classdesc Add signatures to an existing scheduled transaction. + * @implements IScheduleSignTransactionBody + * @constructor + * @param {proto.IScheduleSignTransactionBody=} [p] Properties to set + */ + function ScheduleSignTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A schedule identifier. + * @member {proto.IScheduleID|null|undefined} scheduleID + * @memberof proto.ScheduleSignTransactionBody + * @instance + */ + ScheduleSignTransactionBody.prototype.scheduleID = null; + + /** + * Creates a new ScheduleSignTransactionBody instance using the specified properties. + * @function create + * @memberof proto.ScheduleSignTransactionBody + * @static + * @param {proto.IScheduleSignTransactionBody=} [properties] Properties to set + * @returns {proto.ScheduleSignTransactionBody} ScheduleSignTransactionBody instance + */ + ScheduleSignTransactionBody.create = function create(properties) { + return new ScheduleSignTransactionBody(properties); + }; + + /** + * Encodes the specified ScheduleSignTransactionBody message. Does not implicitly {@link proto.ScheduleSignTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleSignTransactionBody + * @static + * @param {proto.IScheduleSignTransactionBody} m ScheduleSignTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleSignTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.scheduleID != null && Object.hasOwnProperty.call(m, "scheduleID")) + $root.proto.ScheduleID.encode(m.scheduleID, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ScheduleSignTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleSignTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleSignTransactionBody} ScheduleSignTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleSignTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleSignTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.scheduleID = $root.proto.ScheduleID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleSignTransactionBody + * @function getTypeUrl + * @memberof proto.ScheduleSignTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleSignTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleSignTransactionBody"; + }; + + return ScheduleSignTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IScheduleSignTransactionBody|null} [scheduleSign] Sign a schedule. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for schedule sign. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Sign a schedule. + * @member {proto.IScheduleSignTransactionBody|null|undefined} scheduleSign + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.scheduleSign = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"scheduleSign"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["scheduleSign"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.scheduleSign != null && Object.hasOwnProperty.call(m, "scheduleSign")) + $root.proto.ScheduleSignTransactionBody.encode(m.scheduleSign, w.uint32(354).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 44: { + m.scheduleSign = $root.proto.ScheduleSignTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/system_delete_transaction.d.ts b/packages/proto/src/minimal/system_delete_transaction.d.ts new file mode 100644 index 0000000000..cfc5dfa9e0 --- /dev/null +++ b/packages/proto/src/minimal/system_delete_transaction.d.ts @@ -0,0 +1,6402 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_system_delete_transaction; + +declare namespace hashgraph_system_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for system delete. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemDeleteTransactionBody. */ + interface ISystemDeleteTransactionBody { + + /** A file identifier. */ + fileID?: (proto.IFileID|null); + + /** A contract identifier. */ + contractID?: (proto.IContractID|null); + + /** A timestamp indicating when the file will be removed from state. */ + expirationTime?: (proto.ITimestampSeconds|null); + } + + /** Delete a file or contract bytecode as an administrative transaction. */ + class SystemDeleteTransactionBody implements ISystemDeleteTransactionBody { + + /** + * Constructs a new SystemDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ISystemDeleteTransactionBody); + + /** A file identifier. */ + public fileID?: (proto.IFileID|null); + + /** A contract identifier. */ + public contractID?: (proto.IContractID|null); + + /** A timestamp indicating when the file will be removed from state. */ + public expirationTime?: (proto.ITimestampSeconds|null); + + /** SystemDeleteTransactionBody id. */ + public id?: ("fileID"|"contractID"); + + /** + * Creates a new SystemDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemDeleteTransactionBody instance + */ + public static create(properties?: proto.ISystemDeleteTransactionBody): proto.SystemDeleteTransactionBody; + + /** + * Encodes the specified SystemDeleteTransactionBody message. Does not implicitly {@link proto.SystemDeleteTransactionBody.verify|verify} messages. + * @param m SystemDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISystemDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SystemDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SystemDeleteTransactionBody; + + /** + * Gets the default type url for SystemDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete a file or contract as an administrative function. */ + systemDelete?: (proto.ISystemDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for system delete. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete a file or contract as an administrative function. */ + public systemDelete?: (proto.ISystemDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "systemDelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/system_delete_transaction.js b/packages/proto/src/minimal/system_delete_transaction.js new file mode 100644 index 0000000000..dd518a4bdc --- /dev/null +++ b/packages/proto/src/minimal/system_delete_transaction.js @@ -0,0 +1,11161 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_system_delete_transaction || ($protobuf.roots.hashgraph_system_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for system delete. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.SystemDeleteTransactionBody = (function() { + + /** + * Properties of a SystemDeleteTransactionBody. + * @memberof proto + * @interface ISystemDeleteTransactionBody + * @property {proto.IFileID|null} [fileID] A file identifier. + * @property {proto.IContractID|null} [contractID] A contract identifier. + * @property {proto.ITimestampSeconds|null} [expirationTime] A timestamp indicating when the file will be removed from state. + */ + + /** + * Constructs a new SystemDeleteTransactionBody. + * @memberof proto + * @classdesc Delete a file or contract bytecode as an administrative transaction. + * @implements ISystemDeleteTransactionBody + * @constructor + * @param {proto.ISystemDeleteTransactionBody=} [p] Properties to set + */ + function SystemDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A file identifier. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.SystemDeleteTransactionBody + * @instance + */ + SystemDeleteTransactionBody.prototype.fileID = null; + + /** + * A contract identifier. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.SystemDeleteTransactionBody + * @instance + */ + SystemDeleteTransactionBody.prototype.contractID = null; + + /** + * A timestamp indicating when the file will be removed from state. + * @member {proto.ITimestampSeconds|null|undefined} expirationTime + * @memberof proto.SystemDeleteTransactionBody + * @instance + */ + SystemDeleteTransactionBody.prototype.expirationTime = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SystemDeleteTransactionBody id. + * @member {"fileID"|"contractID"|undefined} id + * @memberof proto.SystemDeleteTransactionBody + * @instance + */ + Object.defineProperty(SystemDeleteTransactionBody.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["fileID", "contractID"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SystemDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.SystemDeleteTransactionBody + * @static + * @param {proto.ISystemDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.SystemDeleteTransactionBody} SystemDeleteTransactionBody instance + */ + SystemDeleteTransactionBody.create = function create(properties) { + return new SystemDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified SystemDeleteTransactionBody message. Does not implicitly {@link proto.SystemDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.SystemDeleteTransactionBody + * @static + * @param {proto.ISystemDeleteTransactionBody} m SystemDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(10).fork()).ldelim(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(18).fork()).ldelim(); + if (m.expirationTime != null && Object.hasOwnProperty.call(m, "expirationTime")) + $root.proto.TimestampSeconds.encode(m.expirationTime, w.uint32(26).fork()).ldelim(); + return w; + }; + + /** + * Decodes a SystemDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.SystemDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SystemDeleteTransactionBody} SystemDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SystemDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 2: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 3: { + m.expirationTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SystemDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.SystemDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SystemDeleteTransactionBody"; + }; + + return SystemDeleteTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ISystemDeleteTransactionBody|null} [systemDelete] Delete a file or contract as an administrative function. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for system delete. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete a file or contract as an administrative function. + * @member {proto.ISystemDeleteTransactionBody|null|undefined} systemDelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.systemDelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"systemDelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["systemDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.systemDelete != null && Object.hasOwnProperty.call(m, "systemDelete")) + $root.proto.SystemDeleteTransactionBody.encode(m.systemDelete, w.uint32(162).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 20: { + m.systemDelete = $root.proto.SystemDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/system_undelete_transaction.d.ts b/packages/proto/src/minimal/system_undelete_transaction.d.ts new file mode 100644 index 0000000000..994a07e1b1 --- /dev/null +++ b/packages/proto/src/minimal/system_undelete_transaction.d.ts @@ -0,0 +1,6396 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_system_undelete_transaction; + +declare namespace hashgraph_system_undelete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for system undelete. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SystemUndeleteTransactionBody. */ + interface ISystemUndeleteTransactionBody { + + /** A file identifier. */ + fileID?: (proto.IFileID|null); + + /** A contract identifier. */ + contractID?: (proto.IContractID|null); + } + + /** Recover a file or contract bytecode deleted by a system delete transaction. */ + class SystemUndeleteTransactionBody implements ISystemUndeleteTransactionBody { + + /** + * Constructs a new SystemUndeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ISystemUndeleteTransactionBody); + + /** A file identifier. */ + public fileID?: (proto.IFileID|null); + + /** A contract identifier. */ + public contractID?: (proto.IContractID|null); + + /** SystemUndeleteTransactionBody id. */ + public id?: ("fileID"|"contractID"); + + /** + * Creates a new SystemUndeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns SystemUndeleteTransactionBody instance + */ + public static create(properties?: proto.ISystemUndeleteTransactionBody): proto.SystemUndeleteTransactionBody; + + /** + * Encodes the specified SystemUndeleteTransactionBody message. Does not implicitly {@link proto.SystemUndeleteTransactionBody.verify|verify} messages. + * @param m SystemUndeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISystemUndeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SystemUndeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SystemUndeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SystemUndeleteTransactionBody; + + /** + * Gets the default type url for SystemUndeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Recover a file or contract deleted by system delete. */ + systemUndelete?: (proto.ISystemUndeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for system undelete. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Recover a file or contract deleted by system delete. */ + public systemUndelete?: (proto.ISystemUndeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "systemUndelete"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/system_undelete_transaction.js b/packages/proto/src/minimal/system_undelete_transaction.js new file mode 100644 index 0000000000..2a40305403 --- /dev/null +++ b/packages/proto/src/minimal/system_undelete_transaction.js @@ -0,0 +1,11146 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_system_undelete_transaction || ($protobuf.roots.hashgraph_system_undelete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for system undelete. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.SystemUndeleteTransactionBody = (function() { + + /** + * Properties of a SystemUndeleteTransactionBody. + * @memberof proto + * @interface ISystemUndeleteTransactionBody + * @property {proto.IFileID|null} [fileID] A file identifier. + * @property {proto.IContractID|null} [contractID] A contract identifier. + */ + + /** + * Constructs a new SystemUndeleteTransactionBody. + * @memberof proto + * @classdesc Recover a file or contract bytecode deleted by a system delete transaction. + * @implements ISystemUndeleteTransactionBody + * @constructor + * @param {proto.ISystemUndeleteTransactionBody=} [p] Properties to set + */ + function SystemUndeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A file identifier. + * @member {proto.IFileID|null|undefined} fileID + * @memberof proto.SystemUndeleteTransactionBody + * @instance + */ + SystemUndeleteTransactionBody.prototype.fileID = null; + + /** + * A contract identifier. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.SystemUndeleteTransactionBody + * @instance + */ + SystemUndeleteTransactionBody.prototype.contractID = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SystemUndeleteTransactionBody id. + * @member {"fileID"|"contractID"|undefined} id + * @memberof proto.SystemUndeleteTransactionBody + * @instance + */ + Object.defineProperty(SystemUndeleteTransactionBody.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["fileID", "contractID"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SystemUndeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.SystemUndeleteTransactionBody + * @static + * @param {proto.ISystemUndeleteTransactionBody=} [properties] Properties to set + * @returns {proto.SystemUndeleteTransactionBody} SystemUndeleteTransactionBody instance + */ + SystemUndeleteTransactionBody.create = function create(properties) { + return new SystemUndeleteTransactionBody(properties); + }; + + /** + * Encodes the specified SystemUndeleteTransactionBody message. Does not implicitly {@link proto.SystemUndeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.SystemUndeleteTransactionBody + * @static + * @param {proto.ISystemUndeleteTransactionBody} m SystemUndeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SystemUndeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fileID != null && Object.hasOwnProperty.call(m, "fileID")) + $root.proto.FileID.encode(m.fileID, w.uint32(10).fork()).ldelim(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a SystemUndeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.SystemUndeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SystemUndeleteTransactionBody} SystemUndeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SystemUndeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SystemUndeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fileID = $root.proto.FileID.decode(r, r.uint32()); + break; + } + case 2: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SystemUndeleteTransactionBody + * @function getTypeUrl + * @memberof proto.SystemUndeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SystemUndeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SystemUndeleteTransactionBody"; + }; + + return SystemUndeleteTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ISystemUndeleteTransactionBody|null} [systemUndelete] Recover a file or contract deleted by system delete. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for system undelete. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Recover a file or contract deleted by system delete. + * @member {proto.ISystemUndeleteTransactionBody|null|undefined} systemUndelete + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.systemUndelete = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"systemUndelete"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["systemUndelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.systemUndelete != null && Object.hasOwnProperty.call(m, "systemUndelete")) + $root.proto.SystemUndeleteTransactionBody.encode(m.systemUndelete, w.uint32(170).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 21: { + m.systemUndelete = $root.proto.SystemUndeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_airdrop_transaction.d.ts b/packages/proto/src/minimal/token_airdrop_transaction.d.ts new file mode 100644 index 0000000000..29b9f859d3 --- /dev/null +++ b/packages/proto/src/minimal/token_airdrop_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_airdrop_transaction; + +declare namespace hashgraph_token_airdrop_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token airdrop. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAirdropTransactionBody. */ + interface ITokenAirdropTransactionBody { + + /** A list of token transfers representing one or more airdrops. */ + tokenTransfers?: (proto.ITokenTransferList[]|null); + } + + /** Airdrop one or more tokens to one or more accounts. */ + class TokenAirdropTransactionBody implements ITokenAirdropTransactionBody { + + /** + * Constructs a new TokenAirdropTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAirdropTransactionBody); + + /** A list of token transfers representing one or more airdrops. */ + public tokenTransfers: proto.ITokenTransferList[]; + + /** + * Creates a new TokenAirdropTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAirdropTransactionBody instance + */ + public static create(properties?: proto.ITokenAirdropTransactionBody): proto.TokenAirdropTransactionBody; + + /** + * Encodes the specified TokenAirdropTransactionBody message. Does not implicitly {@link proto.TokenAirdropTransactionBody.verify|verify} messages. + * @param m TokenAirdropTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAirdropTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAirdropTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAirdropTransactionBody; + + /** + * Gets the default type url for TokenAirdropTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Airdrop tokens. */ + tokenAirdrop?: (proto.ITokenAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token airdrop. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Airdrop tokens. */ + public tokenAirdrop?: (proto.ITokenAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenAirdrop"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_airdrop_transaction.js b/packages/proto/src/minimal/token_airdrop_transaction.js new file mode 100644 index 0000000000..39102f6867 --- /dev/null +++ b/packages/proto/src/minimal/token_airdrop_transaction.js @@ -0,0 +1,11122 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_airdrop_transaction || ($protobuf.roots.hashgraph_token_airdrop_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token airdrop. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TokenAirdropTransactionBody = (function() { + + /** + * Properties of a TokenAirdropTransactionBody. + * @memberof proto + * @interface ITokenAirdropTransactionBody + * @property {Array.|null} [tokenTransfers] A list of token transfers representing one or more airdrops. + */ + + /** + * Constructs a new TokenAirdropTransactionBody. + * @memberof proto + * @classdesc Airdrop one or more tokens to one or more accounts. + * @implements ITokenAirdropTransactionBody + * @constructor + * @param {proto.ITokenAirdropTransactionBody=} [p] Properties to set + */ + function TokenAirdropTransactionBody(p) { + this.tokenTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token transfers representing one or more airdrops. + * @member {Array.} tokenTransfers + * @memberof proto.TokenAirdropTransactionBody + * @instance + */ + TokenAirdropTransactionBody.prototype.tokenTransfers = $util.emptyArray; + + /** + * Creates a new TokenAirdropTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenAirdropTransactionBody + * @static + * @param {proto.ITokenAirdropTransactionBody=} [properties] Properties to set + * @returns {proto.TokenAirdropTransactionBody} TokenAirdropTransactionBody instance + */ + TokenAirdropTransactionBody.create = function create(properties) { + return new TokenAirdropTransactionBody(properties); + }; + + /** + * Encodes the specified TokenAirdropTransactionBody message. Does not implicitly {@link proto.TokenAirdropTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenAirdropTransactionBody + * @static + * @param {proto.ITokenAirdropTransactionBody} m TokenAirdropTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAirdropTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenTransfers != null && m.tokenTransfers.length) { + for (var i = 0; i < m.tokenTransfers.length; ++i) + $root.proto.TokenTransferList.encode(m.tokenTransfers[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenAirdropTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAirdropTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAirdropTransactionBody} TokenAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAirdropTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAirdropTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenTransfers && m.tokenTransfers.length)) + m.tokenTransfers = []; + m.tokenTransfers.push($root.proto.TokenTransferList.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAirdropTransactionBody + * @function getTypeUrl + * @memberof proto.TokenAirdropTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAirdropTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAirdropTransactionBody"; + }; + + return TokenAirdropTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenAirdropTransactionBody|null} [tokenAirdrop] Airdrop tokens. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token airdrop. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Airdrop tokens. + * @member {proto.ITokenAirdropTransactionBody|null|undefined} tokenAirdrop + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenAirdrop = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenAirdrop"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenAirdrop"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenAirdrop != null && Object.hasOwnProperty.call(m, "tokenAirdrop")) + $root.proto.TokenAirdropTransactionBody.encode(m.tokenAirdrop, w.uint32(466).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 58: { + m.tokenAirdrop = $root.proto.TokenAirdropTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_associate_transaction.d.ts b/packages/proto/src/minimal/token_associate_transaction.d.ts new file mode 100644 index 0000000000..8adcf3f056 --- /dev/null +++ b/packages/proto/src/minimal/token_associate_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_associate_transaction; + +declare namespace hashgraph_token_associate_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token association. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Associate tokens to an account. */ + tokenAssociate?: (proto.ITokenAssociateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token association. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Associate tokens to an account. */ + public tokenAssociate?: (proto.ITokenAssociateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenAssociate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociateTransactionBody. */ + interface ITokenAssociateTransactionBody { + + /** The account to be associated with the provided tokens. */ + account?: (proto.IAccountID|null); + + /** The tokens to be associated with the provided account. */ + tokens?: (proto.ITokenID[]|null); + } + + /** Associates the provided account with the provided tokens. */ + class TokenAssociateTransactionBody implements ITokenAssociateTransactionBody { + + /** + * Constructs a new TokenAssociateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociateTransactionBody); + + /** The account to be associated with the provided tokens. */ + public account?: (proto.IAccountID|null); + + /** The tokens to be associated with the provided account. */ + public tokens: proto.ITokenID[]; + + /** + * Creates a new TokenAssociateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociateTransactionBody instance + */ + public static create(properties?: proto.ITokenAssociateTransactionBody): proto.TokenAssociateTransactionBody; + + /** + * Encodes the specified TokenAssociateTransactionBody message. Does not implicitly {@link proto.TokenAssociateTransactionBody.verify|verify} messages. + * @param m TokenAssociateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociateTransactionBody; + + /** + * Gets the default type url for TokenAssociateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_associate_transaction.js b/packages/proto/src/minimal/token_associate_transaction.js new file mode 100644 index 0000000000..7209e22cfc --- /dev/null +++ b/packages/proto/src/minimal/token_associate_transaction.js @@ -0,0 +1,11137 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_associate_transaction || ($protobuf.roots.hashgraph_token_associate_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token association. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenAssociateTransactionBody|null} [tokenAssociate] Associate tokens to an account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token association. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Associate tokens to an account. + * @member {proto.ITokenAssociateTransactionBody|null|undefined} tokenAssociate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenAssociate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenAssociate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenAssociate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenAssociate != null && Object.hasOwnProperty.call(m, "tokenAssociate")) + $root.proto.TokenAssociateTransactionBody.encode(m.tokenAssociate, w.uint32(258).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 32: { + m.tokenAssociate = $root.proto.TokenAssociateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenAssociateTransactionBody = (function() { + + /** + * Properties of a TokenAssociateTransactionBody. + * @memberof proto + * @interface ITokenAssociateTransactionBody + * @property {proto.IAccountID|null} [account] The account to be associated with the provided tokens. + * @property {Array.|null} [tokens] The tokens to be associated with the provided account. + */ + + /** + * Constructs a new TokenAssociateTransactionBody. + * @memberof proto + * @classdesc Associates the provided account with the provided tokens. + * @implements ITokenAssociateTransactionBody + * @constructor + * @param {proto.ITokenAssociateTransactionBody=} [p] Properties to set + */ + function TokenAssociateTransactionBody(p) { + this.tokens = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account to be associated with the provided tokens. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenAssociateTransactionBody + * @instance + */ + TokenAssociateTransactionBody.prototype.account = null; + + /** + * The tokens to be associated with the provided account. + * @member {Array.} tokens + * @memberof proto.TokenAssociateTransactionBody + * @instance + */ + TokenAssociateTransactionBody.prototype.tokens = $util.emptyArray; + + /** + * Creates a new TokenAssociateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenAssociateTransactionBody + * @static + * @param {proto.ITokenAssociateTransactionBody=} [properties] Properties to set + * @returns {proto.TokenAssociateTransactionBody} TokenAssociateTransactionBody instance + */ + TokenAssociateTransactionBody.create = function create(properties) { + return new TokenAssociateTransactionBody(properties); + }; + + /** + * Encodes the specified TokenAssociateTransactionBody message. Does not implicitly {@link proto.TokenAssociateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociateTransactionBody + * @static + * @param {proto.ITokenAssociateTransactionBody} m TokenAssociateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(10).fork()).ldelim(); + if (m.tokens != null && m.tokens.length) { + for (var i = 0; i < m.tokens.length; ++i) + $root.proto.TokenID.encode(m.tokens[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenAssociateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociateTransactionBody} TokenAssociateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.tokens && m.tokens.length)) + m.tokens = []; + m.tokens.push($root.proto.TokenID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociateTransactionBody + * @function getTypeUrl + * @memberof proto.TokenAssociateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociateTransactionBody"; + }; + + return TokenAssociateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_burn_transaction.d.ts b/packages/proto/src/minimal/token_burn_transaction.d.ts new file mode 100644 index 0000000000..fe1fa89b12 --- /dev/null +++ b/packages/proto/src/minimal/token_burn_transaction.d.ts @@ -0,0 +1,6411 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_burn_transaction; + +declare namespace hashgraph_token_burn_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token burning. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Burn tokens from the treasury account. */ + tokenBurn?: (proto.ITokenBurnTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token burning. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Burn tokens from the treasury account. */ + public tokenBurn?: (proto.ITokenBurnTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenBurn"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBurnTransactionBody. */ + interface ITokenBurnTransactionBody { + + /** The token for which to burn tokens. */ + token?: (proto.ITokenID|null); + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to burn from the Treasury Account. + */ + amount?: (Long|null); + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * The list of serial numbers to be burned. + */ + serialNumbers?: (Long[]|null); + } + + /** Burns tokens from the Token's treasury Account. */ + class TokenBurnTransactionBody implements ITokenBurnTransactionBody { + + /** + * Constructs a new TokenBurnTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBurnTransactionBody); + + /** The token for which to burn tokens. */ + public token?: (proto.ITokenID|null); + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to burn from the Treasury Account. + */ + public amount: Long; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * The list of serial numbers to be burned. + */ + public serialNumbers: Long[]; + + /** + * Creates a new TokenBurnTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBurnTransactionBody instance + */ + public static create(properties?: proto.ITokenBurnTransactionBody): proto.TokenBurnTransactionBody; + + /** + * Encodes the specified TokenBurnTransactionBody message. Does not implicitly {@link proto.TokenBurnTransactionBody.verify|verify} messages. + * @param m TokenBurnTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBurnTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBurnTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBurnTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBurnTransactionBody; + + /** + * Gets the default type url for TokenBurnTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_burn_transaction.js b/packages/proto/src/minimal/token_burn_transaction.js new file mode 100644 index 0000000000..8d0dd55469 --- /dev/null +++ b/packages/proto/src/minimal/token_burn_transaction.js @@ -0,0 +1,11163 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_burn_transaction || ($protobuf.roots.hashgraph_token_burn_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token burning. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenBurnTransactionBody|null} [tokenBurn] Burn tokens from the treasury account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token burning. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Burn tokens from the treasury account. + * @member {proto.ITokenBurnTransactionBody|null|undefined} tokenBurn + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenBurn = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenBurn"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenBurn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenBurn != null && Object.hasOwnProperty.call(m, "tokenBurn")) + $root.proto.TokenBurnTransactionBody.encode(m.tokenBurn, w.uint32(242).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 30: { + m.tokenBurn = $root.proto.TokenBurnTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenBurnTransactionBody = (function() { + + /** + * Properties of a TokenBurnTransactionBody. + * @memberof proto + * @interface ITokenBurnTransactionBody + * @property {proto.ITokenID|null} [token] The token for which to burn tokens. + * @property {Long|null} [amount] Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to burn from the Treasury Account. + * @property {Array.|null} [serialNumbers] Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * The list of serial numbers to be burned. + */ + + /** + * Constructs a new TokenBurnTransactionBody. + * @memberof proto + * @classdesc Burns tokens from the Token's treasury Account. + * @implements ITokenBurnTransactionBody + * @constructor + * @param {proto.ITokenBurnTransactionBody=} [p] Properties to set + */ + function TokenBurnTransactionBody(p) { + this.serialNumbers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which to burn tokens. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenBurnTransactionBody + * @instance + */ + TokenBurnTransactionBody.prototype.token = null; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to burn from the Treasury Account. + * @member {Long} amount + * @memberof proto.TokenBurnTransactionBody + * @instance + */ + TokenBurnTransactionBody.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * The list of serial numbers to be burned. + * @member {Array.} serialNumbers + * @memberof proto.TokenBurnTransactionBody + * @instance + */ + TokenBurnTransactionBody.prototype.serialNumbers = $util.emptyArray; + + /** + * Creates a new TokenBurnTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenBurnTransactionBody + * @static + * @param {proto.ITokenBurnTransactionBody=} [properties] Properties to set + * @returns {proto.TokenBurnTransactionBody} TokenBurnTransactionBody instance + */ + TokenBurnTransactionBody.create = function create(properties) { + return new TokenBurnTransactionBody(properties); + }; + + /** + * Encodes the specified TokenBurnTransactionBody message. Does not implicitly {@link proto.TokenBurnTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenBurnTransactionBody + * @static + * @param {proto.ITokenBurnTransactionBody} m TokenBurnTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBurnTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).uint64(m.amount); + if (m.serialNumbers != null && m.serialNumbers.length) { + w.uint32(26).fork(); + for (var i = 0; i < m.serialNumbers.length; ++i) + w.int64(m.serialNumbers[i]); + w.ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBurnTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBurnTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBurnTransactionBody} TokenBurnTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBurnTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBurnTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.uint64(); + break; + } + case 3: { + if (!(m.serialNumbers && m.serialNumbers.length)) + m.serialNumbers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.serialNumbers.push(r.int64()); + } else + m.serialNumbers.push(r.int64()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBurnTransactionBody + * @function getTypeUrl + * @memberof proto.TokenBurnTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBurnTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBurnTransactionBody"; + }; + + return TokenBurnTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_cancel_airdrop_transaction.d.ts b/packages/proto/src/minimal/token_cancel_airdrop_transaction.d.ts new file mode 100644 index 0000000000..48a2bba3b7 --- /dev/null +++ b/packages/proto/src/minimal/token_cancel_airdrop_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_cancel_airdrop_transaction; + +declare namespace hashgraph_token_cancel_airdrop_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token cancel airdrop. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenCancelAirdropTransactionBody. */ + interface ITokenCancelAirdropTransactionBody { + + /** A list of one or more pending airdrop identifiers. */ + pendingAirdrops?: (proto.IPendingAirdropId[]|null); + } + + /** Token cancel airdrop - remove pending airdrops from state. */ + class TokenCancelAirdropTransactionBody implements ITokenCancelAirdropTransactionBody { + + /** + * Constructs a new TokenCancelAirdropTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenCancelAirdropTransactionBody); + + /** A list of one or more pending airdrop identifiers. */ + public pendingAirdrops: proto.IPendingAirdropId[]; + + /** + * Creates a new TokenCancelAirdropTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenCancelAirdropTransactionBody instance + */ + public static create(properties?: proto.ITokenCancelAirdropTransactionBody): proto.TokenCancelAirdropTransactionBody; + + /** + * Encodes the specified TokenCancelAirdropTransactionBody message. Does not implicitly {@link proto.TokenCancelAirdropTransactionBody.verify|verify} messages. + * @param m TokenCancelAirdropTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenCancelAirdropTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenCancelAirdropTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenCancelAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenCancelAirdropTransactionBody; + + /** + * Gets the default type url for TokenCancelAirdropTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Cancel one or more pending airdrops. */ + tokenCancelAirdrop?: (proto.ITokenCancelAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token cancel airdrop. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Cancel one or more pending airdrops. */ + public tokenCancelAirdrop?: (proto.ITokenCancelAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenCancelAirdrop"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_cancel_airdrop_transaction.js b/packages/proto/src/minimal/token_cancel_airdrop_transaction.js new file mode 100644 index 0000000000..b8a7a939ee --- /dev/null +++ b/packages/proto/src/minimal/token_cancel_airdrop_transaction.js @@ -0,0 +1,11122 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_cancel_airdrop_transaction || ($protobuf.roots.hashgraph_token_cancel_airdrop_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token cancel airdrop. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TokenCancelAirdropTransactionBody = (function() { + + /** + * Properties of a TokenCancelAirdropTransactionBody. + * @memberof proto + * @interface ITokenCancelAirdropTransactionBody + * @property {Array.|null} [pendingAirdrops] A list of one or more pending airdrop identifiers. + */ + + /** + * Constructs a new TokenCancelAirdropTransactionBody. + * @memberof proto + * @classdesc Token cancel airdrop - remove pending airdrops from state. + * @implements ITokenCancelAirdropTransactionBody + * @constructor + * @param {proto.ITokenCancelAirdropTransactionBody=} [p] Properties to set + */ + function TokenCancelAirdropTransactionBody(p) { + this.pendingAirdrops = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of one or more pending airdrop identifiers. + * @member {Array.} pendingAirdrops + * @memberof proto.TokenCancelAirdropTransactionBody + * @instance + */ + TokenCancelAirdropTransactionBody.prototype.pendingAirdrops = $util.emptyArray; + + /** + * Creates a new TokenCancelAirdropTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenCancelAirdropTransactionBody + * @static + * @param {proto.ITokenCancelAirdropTransactionBody=} [properties] Properties to set + * @returns {proto.TokenCancelAirdropTransactionBody} TokenCancelAirdropTransactionBody instance + */ + TokenCancelAirdropTransactionBody.create = function create(properties) { + return new TokenCancelAirdropTransactionBody(properties); + }; + + /** + * Encodes the specified TokenCancelAirdropTransactionBody message. Does not implicitly {@link proto.TokenCancelAirdropTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenCancelAirdropTransactionBody + * @static + * @param {proto.ITokenCancelAirdropTransactionBody} m TokenCancelAirdropTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenCancelAirdropTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pendingAirdrops != null && m.pendingAirdrops.length) { + for (var i = 0; i < m.pendingAirdrops.length; ++i) + $root.proto.PendingAirdropId.encode(m.pendingAirdrops[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenCancelAirdropTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenCancelAirdropTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenCancelAirdropTransactionBody} TokenCancelAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenCancelAirdropTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenCancelAirdropTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.pendingAirdrops && m.pendingAirdrops.length)) + m.pendingAirdrops = []; + m.pendingAirdrops.push($root.proto.PendingAirdropId.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenCancelAirdropTransactionBody + * @function getTypeUrl + * @memberof proto.TokenCancelAirdropTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenCancelAirdropTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenCancelAirdropTransactionBody"; + }; + + return TokenCancelAirdropTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenCancelAirdropTransactionBody|null} [tokenCancelAirdrop] Cancel one or more pending airdrops. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token cancel airdrop. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Cancel one or more pending airdrops. + * @member {proto.ITokenCancelAirdropTransactionBody|null|undefined} tokenCancelAirdrop + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenCancelAirdrop = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenCancelAirdrop"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenCancelAirdrop"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenCancelAirdrop != null && Object.hasOwnProperty.call(m, "tokenCancelAirdrop")) + $root.proto.TokenCancelAirdropTransactionBody.encode(m.tokenCancelAirdrop, w.uint32(474).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 59: { + m.tokenCancelAirdrop = $root.proto.TokenCancelAirdropTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_claim_airdrop_transaction.d.ts b/packages/proto/src/minimal/token_claim_airdrop_transaction.d.ts new file mode 100644 index 0000000000..38502e3bcf --- /dev/null +++ b/packages/proto/src/minimal/token_claim_airdrop_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_claim_airdrop_transaction; + +declare namespace hashgraph_token_claim_airdrop_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token claim airdrop. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenClaimAirdropTransactionBody. */ + interface ITokenClaimAirdropTransactionBody { + + /** A list of one or more pending airdrop identifiers. */ + pendingAirdrops?: (proto.IPendingAirdropId[]|null); + } + + /** Token claim airdrop - complete pending transfers for an airdrop. */ + class TokenClaimAirdropTransactionBody implements ITokenClaimAirdropTransactionBody { + + /** + * Constructs a new TokenClaimAirdropTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenClaimAirdropTransactionBody); + + /** A list of one or more pending airdrop identifiers. */ + public pendingAirdrops: proto.IPendingAirdropId[]; + + /** + * Creates a new TokenClaimAirdropTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenClaimAirdropTransactionBody instance + */ + public static create(properties?: proto.ITokenClaimAirdropTransactionBody): proto.TokenClaimAirdropTransactionBody; + + /** + * Encodes the specified TokenClaimAirdropTransactionBody message. Does not implicitly {@link proto.TokenClaimAirdropTransactionBody.verify|verify} messages. + * @param m TokenClaimAirdropTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenClaimAirdropTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenClaimAirdropTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenClaimAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenClaimAirdropTransactionBody; + + /** + * Gets the default type url for TokenClaimAirdropTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Claim one or more pending airdrops. */ + tokenClaimAirdrop?: (proto.ITokenClaimAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token claim airdrop. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Claim one or more pending airdrops. */ + public tokenClaimAirdrop?: (proto.ITokenClaimAirdropTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenClaimAirdrop"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_claim_airdrop_transaction.js b/packages/proto/src/minimal/token_claim_airdrop_transaction.js new file mode 100644 index 0000000000..fc162af561 --- /dev/null +++ b/packages/proto/src/minimal/token_claim_airdrop_transaction.js @@ -0,0 +1,11122 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_claim_airdrop_transaction || ($protobuf.roots.hashgraph_token_claim_airdrop_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token claim airdrop. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TokenClaimAirdropTransactionBody = (function() { + + /** + * Properties of a TokenClaimAirdropTransactionBody. + * @memberof proto + * @interface ITokenClaimAirdropTransactionBody + * @property {Array.|null} [pendingAirdrops] A list of one or more pending airdrop identifiers. + */ + + /** + * Constructs a new TokenClaimAirdropTransactionBody. + * @memberof proto + * @classdesc Token claim airdrop - complete pending transfers for an airdrop. + * @implements ITokenClaimAirdropTransactionBody + * @constructor + * @param {proto.ITokenClaimAirdropTransactionBody=} [p] Properties to set + */ + function TokenClaimAirdropTransactionBody(p) { + this.pendingAirdrops = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of one or more pending airdrop identifiers. + * @member {Array.} pendingAirdrops + * @memberof proto.TokenClaimAirdropTransactionBody + * @instance + */ + TokenClaimAirdropTransactionBody.prototype.pendingAirdrops = $util.emptyArray; + + /** + * Creates a new TokenClaimAirdropTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenClaimAirdropTransactionBody + * @static + * @param {proto.ITokenClaimAirdropTransactionBody=} [properties] Properties to set + * @returns {proto.TokenClaimAirdropTransactionBody} TokenClaimAirdropTransactionBody instance + */ + TokenClaimAirdropTransactionBody.create = function create(properties) { + return new TokenClaimAirdropTransactionBody(properties); + }; + + /** + * Encodes the specified TokenClaimAirdropTransactionBody message. Does not implicitly {@link proto.TokenClaimAirdropTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenClaimAirdropTransactionBody + * @static + * @param {proto.ITokenClaimAirdropTransactionBody} m TokenClaimAirdropTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenClaimAirdropTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pendingAirdrops != null && m.pendingAirdrops.length) { + for (var i = 0; i < m.pendingAirdrops.length; ++i) + $root.proto.PendingAirdropId.encode(m.pendingAirdrops[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenClaimAirdropTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenClaimAirdropTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenClaimAirdropTransactionBody} TokenClaimAirdropTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenClaimAirdropTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenClaimAirdropTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.pendingAirdrops && m.pendingAirdrops.length)) + m.pendingAirdrops = []; + m.pendingAirdrops.push($root.proto.PendingAirdropId.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenClaimAirdropTransactionBody + * @function getTypeUrl + * @memberof proto.TokenClaimAirdropTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenClaimAirdropTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenClaimAirdropTransactionBody"; + }; + + return TokenClaimAirdropTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenClaimAirdropTransactionBody|null} [tokenClaimAirdrop] Claim one or more pending airdrops. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token claim airdrop. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Claim one or more pending airdrops. + * @member {proto.ITokenClaimAirdropTransactionBody|null|undefined} tokenClaimAirdrop + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenClaimAirdrop = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenClaimAirdrop"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenClaimAirdrop"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenClaimAirdrop != null && Object.hasOwnProperty.call(m, "tokenClaimAirdrop")) + $root.proto.TokenClaimAirdropTransactionBody.encode(m.tokenClaimAirdrop, w.uint32(482).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 60: { + m.tokenClaimAirdrop = $root.proto.TokenClaimAirdropTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_create_transaction.d.ts b/packages/proto/src/minimal/token_create_transaction.d.ts new file mode 100644 index 0000000000..96836389fd --- /dev/null +++ b/packages/proto/src/minimal/token_create_transaction.d.ts @@ -0,0 +1,6519 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_create_transaction; + +declare namespace hashgraph_token_create_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token creation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Create a new Hedera token. */ + tokenCreation?: (proto.ITokenCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token creation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Create a new Hedera token. */ + public tokenCreation?: (proto.ITokenCreateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenCreation"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenCreateTransactionBody. */ + interface ITokenCreateTransactionBody { + + /** The publicly visible name of the token. */ + name?: (string|null); + + /** The publicly visible token symbol. */ + symbol?: (string|null); + + /** The number of decimal places a token is divisible by. */ + decimals?: (number|null); + + /** Specifies the initial supply of tokens to be put in circulation. */ + initialSupply?: (Long|null); + + /** The account which will act as a treasury for the token. */ + treasury?: (proto.IAccountID|null); + + /** The key which can perform update/delete operations on the token. */ + adminKey?: (proto.IKey|null); + + /** The key which can grant or revoke KYC of an account for the token's transactions. */ + kycKey?: (proto.IKey|null); + + /** The key which can sign to freeze or unfreeze an account for token transactions. */ + freezeKey?: (proto.IKey|null); + + /** The key which can wipe the token balance of an account. */ + wipeKey?: (proto.IKey|null); + + /** The key which can change the supply of a token. */ + supplyKey?: (proto.IKey|null); + + /** The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. */ + freezeDefault?: (boolean|null); + + /** The epoch second at which the token should expire. */ + expiry?: (proto.ITimestamp|null); + + /** An account which will be automatically charged to renew the token's expiration. */ + autoRenewAccount?: (proto.IAccountID|null); + + /** The interval at which the auto-renew account will be charged to extend the token's expiry. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** The memo associated with the token. */ + memo?: (string|null); + + /** IWA compatibility. Specifies the token type. */ + tokenType?: (proto.TokenType|null); + + /** IWA compatibility. Specified the supply type of the token. */ + supplyType?: (proto.TokenSupplyType|null); + + /** IWA Compatibility. Depends on TokenSupplyType. */ + maxSupply?: (Long|null); + + /** The key which can change the token's custom fee schedule. */ + feeScheduleKey?: (proto.IKey|null); + + /** The custom fees to be assessed during a CryptoTransfer that transfers units of this token. */ + customFees?: (proto.ICustomFee[]|null); + + /** The key which can pause and unpause the Token. */ + pauseKey?: (proto.IKey|null); + + /** Metadata that is passed through and not validated. */ + metadata?: (Uint8Array|null); + + /** The key which can update the metadata of a token. */ + metadataKey?: (proto.IKey|null); + } + + /** Create a new token. */ + class TokenCreateTransactionBody implements ITokenCreateTransactionBody { + + /** + * Constructs a new TokenCreateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenCreateTransactionBody); + + /** The publicly visible name of the token. */ + public name: string; + + /** The publicly visible token symbol. */ + public symbol: string; + + /** The number of decimal places a token is divisible by. */ + public decimals: number; + + /** Specifies the initial supply of tokens to be put in circulation. */ + public initialSupply: Long; + + /** The account which will act as a treasury for the token. */ + public treasury?: (proto.IAccountID|null); + + /** The key which can perform update/delete operations on the token. */ + public adminKey?: (proto.IKey|null); + + /** The key which can grant or revoke KYC of an account for the token's transactions. */ + public kycKey?: (proto.IKey|null); + + /** The key which can sign to freeze or unfreeze an account for token transactions. */ + public freezeKey?: (proto.IKey|null); + + /** The key which can wipe the token balance of an account. */ + public wipeKey?: (proto.IKey|null); + + /** The key which can change the supply of a token. */ + public supplyKey?: (proto.IKey|null); + + /** The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. */ + public freezeDefault: boolean; + + /** The epoch second at which the token should expire. */ + public expiry?: (proto.ITimestamp|null); + + /** An account which will be automatically charged to renew the token's expiration. */ + public autoRenewAccount?: (proto.IAccountID|null); + + /** The interval at which the auto-renew account will be charged to extend the token's expiry. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** The memo associated with the token. */ + public memo: string; + + /** IWA compatibility. Specifies the token type. */ + public tokenType: proto.TokenType; + + /** IWA compatibility. Specified the supply type of the token. */ + public supplyType: proto.TokenSupplyType; + + /** IWA Compatibility. Depends on TokenSupplyType. */ + public maxSupply: Long; + + /** The key which can change the token's custom fee schedule. */ + public feeScheduleKey?: (proto.IKey|null); + + /** The custom fees to be assessed during a CryptoTransfer that transfers units of this token. */ + public customFees: proto.ICustomFee[]; + + /** The key which can pause and unpause the Token. */ + public pauseKey?: (proto.IKey|null); + + /** Metadata that is passed through and not validated. */ + public metadata: Uint8Array; + + /** The key which can update the metadata of a token. */ + public metadataKey?: (proto.IKey|null); + + /** + * Creates a new TokenCreateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenCreateTransactionBody instance + */ + public static create(properties?: proto.ITokenCreateTransactionBody): proto.TokenCreateTransactionBody; + + /** + * Encodes the specified TokenCreateTransactionBody message. Does not implicitly {@link proto.TokenCreateTransactionBody.verify|verify} messages. + * @param m TokenCreateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenCreateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenCreateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenCreateTransactionBody; + + /** + * Gets the default type url for TokenCreateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_create_transaction.js b/packages/proto/src/minimal/token_create_transaction.js new file mode 100644 index 0000000000..2f915d148f --- /dev/null +++ b/packages/proto/src/minimal/token_create_transaction.js @@ -0,0 +1,11452 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_create_transaction || ($protobuf.roots.hashgraph_token_create_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token creation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenCreateTransactionBody|null} [tokenCreation] Create a new Hedera token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token creation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Create a new Hedera token. + * @member {proto.ITokenCreateTransactionBody|null|undefined} tokenCreation + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenCreation = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenCreation"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenCreation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenCreation != null && Object.hasOwnProperty.call(m, "tokenCreation")) + $root.proto.TokenCreateTransactionBody.encode(m.tokenCreation, w.uint32(234).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 29: { + m.tokenCreation = $root.proto.TokenCreateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenCreateTransactionBody = (function() { + + /** + * Properties of a TokenCreateTransactionBody. + * @memberof proto + * @interface ITokenCreateTransactionBody + * @property {string|null} [name] The publicly visible name of the token. + * @property {string|null} [symbol] The publicly visible token symbol. + * @property {number|null} [decimals] The number of decimal places a token is divisible by. + * @property {Long|null} [initialSupply] Specifies the initial supply of tokens to be put in circulation. + * @property {proto.IAccountID|null} [treasury] The account which will act as a treasury for the token. + * @property {proto.IKey|null} [adminKey] The key which can perform update/delete operations on the token. + * @property {proto.IKey|null} [kycKey] The key which can grant or revoke KYC of an account for the token's transactions. + * @property {proto.IKey|null} [freezeKey] The key which can sign to freeze or unfreeze an account for token transactions. + * @property {proto.IKey|null} [wipeKey] The key which can wipe the token balance of an account. + * @property {proto.IKey|null} [supplyKey] The key which can change the supply of a token. + * @property {boolean|null} [freezeDefault] The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. + * @property {proto.ITimestamp|null} [expiry] The epoch second at which the token should expire. + * @property {proto.IAccountID|null} [autoRenewAccount] An account which will be automatically charged to renew the token's expiration. + * @property {proto.IDuration|null} [autoRenewPeriod] The interval at which the auto-renew account will be charged to extend the token's expiry. + * @property {string|null} [memo] The memo associated with the token. + * @property {proto.TokenType|null} [tokenType] IWA compatibility. Specifies the token type. + * @property {proto.TokenSupplyType|null} [supplyType] IWA compatibility. Specified the supply type of the token. + * @property {Long|null} [maxSupply] IWA Compatibility. Depends on TokenSupplyType. + * @property {proto.IKey|null} [feeScheduleKey] The key which can change the token's custom fee schedule. + * @property {Array.|null} [customFees] The custom fees to be assessed during a CryptoTransfer that transfers units of this token. + * @property {proto.IKey|null} [pauseKey] The key which can pause and unpause the Token. + * @property {Uint8Array|null} [metadata] Metadata that is passed through and not validated. + * @property {proto.IKey|null} [metadataKey] The key which can update the metadata of a token. + */ + + /** + * Constructs a new TokenCreateTransactionBody. + * @memberof proto + * @classdesc Create a new token. + * @implements ITokenCreateTransactionBody + * @constructor + * @param {proto.ITokenCreateTransactionBody=} [p] Properties to set + */ + function TokenCreateTransactionBody(p) { + this.customFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The publicly visible name of the token. + * @member {string} name + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.name = ""; + + /** + * The publicly visible token symbol. + * @member {string} symbol + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.symbol = ""; + + /** + * The number of decimal places a token is divisible by. + * @member {number} decimals + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.decimals = 0; + + /** + * Specifies the initial supply of tokens to be put in circulation. + * @member {Long} initialSupply + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.initialSupply = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * The account which will act as a treasury for the token. + * @member {proto.IAccountID|null|undefined} treasury + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.treasury = null; + + /** + * The key which can perform update/delete operations on the token. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.adminKey = null; + + /** + * The key which can grant or revoke KYC of an account for the token's transactions. + * @member {proto.IKey|null|undefined} kycKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.kycKey = null; + + /** + * The key which can sign to freeze or unfreeze an account for token transactions. + * @member {proto.IKey|null|undefined} freezeKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.freezeKey = null; + + /** + * The key which can wipe the token balance of an account. + * @member {proto.IKey|null|undefined} wipeKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.wipeKey = null; + + /** + * The key which can change the supply of a token. + * @member {proto.IKey|null|undefined} supplyKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.supplyKey = null; + + /** + * The default Freeze status (frozen or unfrozen) of Hedera accounts relative to this token. + * @member {boolean} freezeDefault + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.freezeDefault = false; + + /** + * The epoch second at which the token should expire. + * @member {proto.ITimestamp|null|undefined} expiry + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.expiry = null; + + /** + * An account which will be automatically charged to renew the token's expiration. + * @member {proto.IAccountID|null|undefined} autoRenewAccount + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.autoRenewAccount = null; + + /** + * The interval at which the auto-renew account will be charged to extend the token's expiry. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * The memo associated with the token. + * @member {string} memo + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.memo = ""; + + /** + * IWA compatibility. Specifies the token type. + * @member {proto.TokenType} tokenType + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.tokenType = 0; + + /** + * IWA compatibility. Specified the supply type of the token. + * @member {proto.TokenSupplyType} supplyType + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.supplyType = 0; + + /** + * IWA Compatibility. Depends on TokenSupplyType. + * @member {Long} maxSupply + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.maxSupply = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The key which can change the token's custom fee schedule. + * @member {proto.IKey|null|undefined} feeScheduleKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.feeScheduleKey = null; + + /** + * The custom fees to be assessed during a CryptoTransfer that transfers units of this token. + * @member {Array.} customFees + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.customFees = $util.emptyArray; + + /** + * The key which can pause and unpause the Token. + * @member {proto.IKey|null|undefined} pauseKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.pauseKey = null; + + /** + * Metadata that is passed through and not validated. + * @member {Uint8Array} metadata + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.metadata = $util.newBuffer([]); + + /** + * The key which can update the metadata of a token. + * @member {proto.IKey|null|undefined} metadataKey + * @memberof proto.TokenCreateTransactionBody + * @instance + */ + TokenCreateTransactionBody.prototype.metadataKey = null; + + /** + * Creates a new TokenCreateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenCreateTransactionBody + * @static + * @param {proto.ITokenCreateTransactionBody=} [properties] Properties to set + * @returns {proto.TokenCreateTransactionBody} TokenCreateTransactionBody instance + */ + TokenCreateTransactionBody.create = function create(properties) { + return new TokenCreateTransactionBody(properties); + }; + + /** + * Encodes the specified TokenCreateTransactionBody message. Does not implicitly {@link proto.TokenCreateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenCreateTransactionBody + * @static + * @param {proto.ITokenCreateTransactionBody} m TokenCreateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenCreateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + if (m.initialSupply != null && Object.hasOwnProperty.call(m, "initialSupply")) + w.uint32(32).uint64(m.initialSupply); + if (m.treasury != null && Object.hasOwnProperty.call(m, "treasury")) + $root.proto.AccountID.encode(m.treasury, w.uint32(42).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(50).fork()).ldelim(); + if (m.kycKey != null && Object.hasOwnProperty.call(m, "kycKey")) + $root.proto.Key.encode(m.kycKey, w.uint32(58).fork()).ldelim(); + if (m.freezeKey != null && Object.hasOwnProperty.call(m, "freezeKey")) + $root.proto.Key.encode(m.freezeKey, w.uint32(66).fork()).ldelim(); + if (m.wipeKey != null && Object.hasOwnProperty.call(m, "wipeKey")) + $root.proto.Key.encode(m.wipeKey, w.uint32(74).fork()).ldelim(); + if (m.supplyKey != null && Object.hasOwnProperty.call(m, "supplyKey")) + $root.proto.Key.encode(m.supplyKey, w.uint32(82).fork()).ldelim(); + if (m.freezeDefault != null && Object.hasOwnProperty.call(m, "freezeDefault")) + w.uint32(88).bool(m.freezeDefault); + if (m.expiry != null && Object.hasOwnProperty.call(m, "expiry")) + $root.proto.Timestamp.encode(m.expiry, w.uint32(106).fork()).ldelim(); + if (m.autoRenewAccount != null && Object.hasOwnProperty.call(m, "autoRenewAccount")) + $root.proto.AccountID.encode(m.autoRenewAccount, w.uint32(114).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(122).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(130).string(m.memo); + if (m.tokenType != null && Object.hasOwnProperty.call(m, "tokenType")) + w.uint32(136).int32(m.tokenType); + if (m.supplyType != null && Object.hasOwnProperty.call(m, "supplyType")) + w.uint32(144).int32(m.supplyType); + if (m.maxSupply != null && Object.hasOwnProperty.call(m, "maxSupply")) + w.uint32(152).int64(m.maxSupply); + if (m.feeScheduleKey != null && Object.hasOwnProperty.call(m, "feeScheduleKey")) + $root.proto.Key.encode(m.feeScheduleKey, w.uint32(162).fork()).ldelim(); + if (m.customFees != null && m.customFees.length) { + for (var i = 0; i < m.customFees.length; ++i) + $root.proto.CustomFee.encode(m.customFees[i], w.uint32(170).fork()).ldelim(); + } + if (m.pauseKey != null && Object.hasOwnProperty.call(m, "pauseKey")) + $root.proto.Key.encode(m.pauseKey, w.uint32(178).fork()).ldelim(); + if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata")) + w.uint32(186).bytes(m.metadata); + if (m.metadataKey != null && Object.hasOwnProperty.call(m, "metadataKey")) + $root.proto.Key.encode(m.metadataKey, w.uint32(194).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenCreateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenCreateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenCreateTransactionBody} TokenCreateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenCreateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenCreateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + case 4: { + m.initialSupply = r.uint64(); + break; + } + case 5: { + m.treasury = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 7: { + m.kycKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.freezeKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 9: { + m.wipeKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 10: { + m.supplyKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 11: { + m.freezeDefault = r.bool(); + break; + } + case 13: { + m.expiry = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 14: { + m.autoRenewAccount = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 15: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 16: { + m.memo = r.string(); + break; + } + case 17: { + m.tokenType = r.int32(); + break; + } + case 18: { + m.supplyType = r.int32(); + break; + } + case 19: { + m.maxSupply = r.int64(); + break; + } + case 20: { + m.feeScheduleKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 21: { + if (!(m.customFees && m.customFees.length)) + m.customFees = []; + m.customFees.push($root.proto.CustomFee.decode(r, r.uint32())); + break; + } + case 22: { + m.pauseKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 23: { + m.metadata = r.bytes(); + break; + } + case 24: { + m.metadataKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenCreateTransactionBody + * @function getTypeUrl + * @memberof proto.TokenCreateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenCreateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenCreateTransactionBody"; + }; + + return TokenCreateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_delete_transaction.d.ts b/packages/proto/src/minimal/token_delete_transaction.d.ts new file mode 100644 index 0000000000..d2f413604b --- /dev/null +++ b/packages/proto/src/minimal/token_delete_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_delete_transaction; + +declare namespace hashgraph_token_delete_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token deletion. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Delete an Hedera token. */ + tokenDeletion?: (proto.ITokenDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token deletion. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Delete an Hedera token. */ + public tokenDeletion?: (proto.ITokenDeleteTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenDeletion"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenDeleteTransactionBody. */ + interface ITokenDeleteTransactionBody { + + /** The token to be deleted. */ + token?: (proto.ITokenID|null); + } + + /** Marks a token as deleted. */ + class TokenDeleteTransactionBody implements ITokenDeleteTransactionBody { + + /** + * Constructs a new TokenDeleteTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenDeleteTransactionBody); + + /** The token to be deleted. */ + public token?: (proto.ITokenID|null); + + /** + * Creates a new TokenDeleteTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenDeleteTransactionBody instance + */ + public static create(properties?: proto.ITokenDeleteTransactionBody): proto.TokenDeleteTransactionBody; + + /** + * Encodes the specified TokenDeleteTransactionBody message. Does not implicitly {@link proto.TokenDeleteTransactionBody.verify|verify} messages. + * @param m TokenDeleteTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenDeleteTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenDeleteTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenDeleteTransactionBody; + + /** + * Gets the default type url for TokenDeleteTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_delete_transaction.js b/packages/proto/src/minimal/token_delete_transaction.js new file mode 100644 index 0000000000..f6896abd64 --- /dev/null +++ b/packages/proto/src/minimal/token_delete_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_delete_transaction || ($protobuf.roots.hashgraph_token_delete_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token deletion. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenDeleteTransactionBody|null} [tokenDeletion] Delete an Hedera token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token deletion. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Delete an Hedera token. + * @member {proto.ITokenDeleteTransactionBody|null|undefined} tokenDeletion + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenDeletion = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenDeletion"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenDeletion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenDeletion != null && Object.hasOwnProperty.call(m, "tokenDeletion")) + $root.proto.TokenDeleteTransactionBody.encode(m.tokenDeletion, w.uint32(218).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 27: { + m.tokenDeletion = $root.proto.TokenDeleteTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenDeleteTransactionBody = (function() { + + /** + * Properties of a TokenDeleteTransactionBody. + * @memberof proto + * @interface ITokenDeleteTransactionBody + * @property {proto.ITokenID|null} [token] The token to be deleted. + */ + + /** + * Constructs a new TokenDeleteTransactionBody. + * @memberof proto + * @classdesc Marks a token as deleted. + * @implements ITokenDeleteTransactionBody + * @constructor + * @param {proto.ITokenDeleteTransactionBody=} [p] Properties to set + */ + function TokenDeleteTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token to be deleted. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenDeleteTransactionBody + * @instance + */ + TokenDeleteTransactionBody.prototype.token = null; + + /** + * Creates a new TokenDeleteTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenDeleteTransactionBody + * @static + * @param {proto.ITokenDeleteTransactionBody=} [properties] Properties to set + * @returns {proto.TokenDeleteTransactionBody} TokenDeleteTransactionBody instance + */ + TokenDeleteTransactionBody.create = function create(properties) { + return new TokenDeleteTransactionBody(properties); + }; + + /** + * Encodes the specified TokenDeleteTransactionBody message. Does not implicitly {@link proto.TokenDeleteTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenDeleteTransactionBody + * @static + * @param {proto.ITokenDeleteTransactionBody} m TokenDeleteTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDeleteTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenDeleteTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenDeleteTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenDeleteTransactionBody} TokenDeleteTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDeleteTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenDeleteTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenDeleteTransactionBody + * @function getTypeUrl + * @memberof proto.TokenDeleteTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenDeleteTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenDeleteTransactionBody"; + }; + + return TokenDeleteTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_dissociate_transaction.d.ts b/packages/proto/src/minimal/token_dissociate_transaction.d.ts new file mode 100644 index 0000000000..fdb9d7836e --- /dev/null +++ b/packages/proto/src/minimal/token_dissociate_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_dissociate_transaction; + +declare namespace hashgraph_token_dissociate_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token dissociation. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Dissociate tokens from an account. */ + tokenDissociate?: (proto.ITokenDissociateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token dissociation. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Dissociate tokens from an account. */ + public tokenDissociate?: (proto.ITokenDissociateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenDissociate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenDissociateTransactionBody. */ + interface ITokenDissociateTransactionBody { + + /** The account to be dissociated from the provided tokens. */ + account?: (proto.IAccountID|null); + + /** The tokens to be dissociated from the provided account. */ + tokens?: (proto.ITokenID[]|null); + } + + /** Dissociates the provided account with the provided tokens. */ + class TokenDissociateTransactionBody implements ITokenDissociateTransactionBody { + + /** + * Constructs a new TokenDissociateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenDissociateTransactionBody); + + /** The account to be dissociated from the provided tokens. */ + public account?: (proto.IAccountID|null); + + /** The tokens to be dissociated from the provided account. */ + public tokens: proto.ITokenID[]; + + /** + * Creates a new TokenDissociateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenDissociateTransactionBody instance + */ + public static create(properties?: proto.ITokenDissociateTransactionBody): proto.TokenDissociateTransactionBody; + + /** + * Encodes the specified TokenDissociateTransactionBody message. Does not implicitly {@link proto.TokenDissociateTransactionBody.verify|verify} messages. + * @param m TokenDissociateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenDissociateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenDissociateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenDissociateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenDissociateTransactionBody; + + /** + * Gets the default type url for TokenDissociateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_dissociate_transaction.js b/packages/proto/src/minimal/token_dissociate_transaction.js new file mode 100644 index 0000000000..5b4aebfb78 --- /dev/null +++ b/packages/proto/src/minimal/token_dissociate_transaction.js @@ -0,0 +1,11137 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_dissociate_transaction || ($protobuf.roots.hashgraph_token_dissociate_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token dissociation. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenDissociateTransactionBody|null} [tokenDissociate] Dissociate tokens from an account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token dissociation. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Dissociate tokens from an account. + * @member {proto.ITokenDissociateTransactionBody|null|undefined} tokenDissociate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenDissociate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenDissociate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenDissociate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenDissociate != null && Object.hasOwnProperty.call(m, "tokenDissociate")) + $root.proto.TokenDissociateTransactionBody.encode(m.tokenDissociate, w.uint32(266).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 33: { + m.tokenDissociate = $root.proto.TokenDissociateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenDissociateTransactionBody = (function() { + + /** + * Properties of a TokenDissociateTransactionBody. + * @memberof proto + * @interface ITokenDissociateTransactionBody + * @property {proto.IAccountID|null} [account] The account to be dissociated from the provided tokens. + * @property {Array.|null} [tokens] The tokens to be dissociated from the provided account. + */ + + /** + * Constructs a new TokenDissociateTransactionBody. + * @memberof proto + * @classdesc Dissociates the provided account with the provided tokens. + * @implements ITokenDissociateTransactionBody + * @constructor + * @param {proto.ITokenDissociateTransactionBody=} [p] Properties to set + */ + function TokenDissociateTransactionBody(p) { + this.tokens = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The account to be dissociated from the provided tokens. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenDissociateTransactionBody + * @instance + */ + TokenDissociateTransactionBody.prototype.account = null; + + /** + * The tokens to be dissociated from the provided account. + * @member {Array.} tokens + * @memberof proto.TokenDissociateTransactionBody + * @instance + */ + TokenDissociateTransactionBody.prototype.tokens = $util.emptyArray; + + /** + * Creates a new TokenDissociateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenDissociateTransactionBody + * @static + * @param {proto.ITokenDissociateTransactionBody=} [properties] Properties to set + * @returns {proto.TokenDissociateTransactionBody} TokenDissociateTransactionBody instance + */ + TokenDissociateTransactionBody.create = function create(properties) { + return new TokenDissociateTransactionBody(properties); + }; + + /** + * Encodes the specified TokenDissociateTransactionBody message. Does not implicitly {@link proto.TokenDissociateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenDissociateTransactionBody + * @static + * @param {proto.ITokenDissociateTransactionBody} m TokenDissociateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenDissociateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(10).fork()).ldelim(); + if (m.tokens != null && m.tokens.length) { + for (var i = 0; i < m.tokens.length; ++i) + $root.proto.TokenID.encode(m.tokens[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenDissociateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenDissociateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenDissociateTransactionBody} TokenDissociateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenDissociateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenDissociateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.tokens && m.tokens.length)) + m.tokens = []; + m.tokens.push($root.proto.TokenID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenDissociateTransactionBody + * @function getTypeUrl + * @memberof proto.TokenDissociateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenDissociateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenDissociateTransactionBody"; + }; + + return TokenDissociateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_fee_schedule_update_transaction.d.ts b/packages/proto/src/minimal/token_fee_schedule_update_transaction.d.ts new file mode 100644 index 0000000000..1cff0abd38 --- /dev/null +++ b/packages/proto/src/minimal/token_fee_schedule_update_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_fee_schedule_update_transaction; + +declare namespace hashgraph_token_fee_schedule_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token fee schedule update. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenFeeScheduleUpdateTransactionBody. */ + interface ITokenFeeScheduleUpdateTransactionBody { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** A list of custom fees representing a fee schedule. */ + customFees?: (proto.ICustomFee[]|null); + } + + /** Update the custom fee schedule for a token type. */ + class TokenFeeScheduleUpdateTransactionBody implements ITokenFeeScheduleUpdateTransactionBody { + + /** + * Constructs a new TokenFeeScheduleUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenFeeScheduleUpdateTransactionBody); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** A list of custom fees representing a fee schedule. */ + public customFees: proto.ICustomFee[]; + + /** + * Creates a new TokenFeeScheduleUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenFeeScheduleUpdateTransactionBody instance + */ + public static create(properties?: proto.ITokenFeeScheduleUpdateTransactionBody): proto.TokenFeeScheduleUpdateTransactionBody; + + /** + * Encodes the specified TokenFeeScheduleUpdateTransactionBody message. Does not implicitly {@link proto.TokenFeeScheduleUpdateTransactionBody.verify|verify} messages. + * @param m TokenFeeScheduleUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenFeeScheduleUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenFeeScheduleUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenFeeScheduleUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenFeeScheduleUpdateTransactionBody; + + /** + * Gets the default type url for TokenFeeScheduleUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update the custom fee schedule for a token. */ + tokenFeeScheduleUpdate?: (proto.ITokenFeeScheduleUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token fee schedule update. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update the custom fee schedule for a token. */ + public tokenFeeScheduleUpdate?: (proto.ITokenFeeScheduleUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenFeeScheduleUpdate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_fee_schedule_update_transaction.js b/packages/proto/src/minimal/token_fee_schedule_update_transaction.js new file mode 100644 index 0000000000..527a7b8dd5 --- /dev/null +++ b/packages/proto/src/minimal/token_fee_schedule_update_transaction.js @@ -0,0 +1,11137 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_fee_schedule_update_transaction || ($protobuf.roots.hashgraph_token_fee_schedule_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token fee schedule update. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TokenFeeScheduleUpdateTransactionBody = (function() { + + /** + * Properties of a TokenFeeScheduleUpdateTransactionBody. + * @memberof proto + * @interface ITokenFeeScheduleUpdateTransactionBody + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Array.|null} [customFees] A list of custom fees representing a fee schedule. + */ + + /** + * Constructs a new TokenFeeScheduleUpdateTransactionBody. + * @memberof proto + * @classdesc Update the custom fee schedule for a token type. + * @implements ITokenFeeScheduleUpdateTransactionBody + * @constructor + * @param {proto.ITokenFeeScheduleUpdateTransactionBody=} [p] Properties to set + */ + function TokenFeeScheduleUpdateTransactionBody(p) { + this.customFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @instance + */ + TokenFeeScheduleUpdateTransactionBody.prototype.tokenId = null; + + /** + * A list of custom fees representing a fee schedule. + * @member {Array.} customFees + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @instance + */ + TokenFeeScheduleUpdateTransactionBody.prototype.customFees = $util.emptyArray; + + /** + * Creates a new TokenFeeScheduleUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @static + * @param {proto.ITokenFeeScheduleUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.TokenFeeScheduleUpdateTransactionBody} TokenFeeScheduleUpdateTransactionBody instance + */ + TokenFeeScheduleUpdateTransactionBody.create = function create(properties) { + return new TokenFeeScheduleUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified TokenFeeScheduleUpdateTransactionBody message. Does not implicitly {@link proto.TokenFeeScheduleUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @static + * @param {proto.ITokenFeeScheduleUpdateTransactionBody} m TokenFeeScheduleUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenFeeScheduleUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.customFees != null && m.customFees.length) { + for (var i = 0; i < m.customFees.length; ++i) + $root.proto.CustomFee.encode(m.customFees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenFeeScheduleUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenFeeScheduleUpdateTransactionBody} TokenFeeScheduleUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenFeeScheduleUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenFeeScheduleUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.customFees && m.customFees.length)) + m.customFees = []; + m.customFees.push($root.proto.CustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenFeeScheduleUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.TokenFeeScheduleUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenFeeScheduleUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenFeeScheduleUpdateTransactionBody"; + }; + + return TokenFeeScheduleUpdateTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenFeeScheduleUpdateTransactionBody|null} [tokenFeeScheduleUpdate] Update the custom fee schedule for a token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token fee schedule update. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update the custom fee schedule for a token. + * @member {proto.ITokenFeeScheduleUpdateTransactionBody|null|undefined} tokenFeeScheduleUpdate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenFeeScheduleUpdate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenFeeScheduleUpdate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenFeeScheduleUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenFeeScheduleUpdate != null && Object.hasOwnProperty.call(m, "tokenFeeScheduleUpdate")) + $root.proto.TokenFeeScheduleUpdateTransactionBody.encode(m.tokenFeeScheduleUpdate, w.uint32(362).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 45: { + m.tokenFeeScheduleUpdate = $root.proto.TokenFeeScheduleUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_freeze_account_transaction.d.ts b/packages/proto/src/minimal/token_freeze_account_transaction.d.ts new file mode 100644 index 0000000000..f39ac305d8 --- /dev/null +++ b/packages/proto/src/minimal/token_freeze_account_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_freeze_account_transaction; + +declare namespace hashgraph_token_freeze_account_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token account freezing. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Freeze an account with respect to a token. */ + tokenFreeze?: (proto.ITokenFreezeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token account freezing. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Freeze an account with respect to a token. */ + public tokenFreeze?: (proto.ITokenFreezeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenFreeze"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenFreezeAccountTransactionBody. */ + interface ITokenFreezeAccountTransactionBody { + + /** The token for which this account will be frozen. */ + token?: (proto.ITokenID|null); + + /** The account to be frozen. */ + account?: (proto.IAccountID|null); + } + + /** Freezes transfers of the specified token for the account. */ + class TokenFreezeAccountTransactionBody implements ITokenFreezeAccountTransactionBody { + + /** + * Constructs a new TokenFreezeAccountTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenFreezeAccountTransactionBody); + + /** The token for which this account will be frozen. */ + public token?: (proto.ITokenID|null); + + /** The account to be frozen. */ + public account?: (proto.IAccountID|null); + + /** + * Creates a new TokenFreezeAccountTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenFreezeAccountTransactionBody instance + */ + public static create(properties?: proto.ITokenFreezeAccountTransactionBody): proto.TokenFreezeAccountTransactionBody; + + /** + * Encodes the specified TokenFreezeAccountTransactionBody message. Does not implicitly {@link proto.TokenFreezeAccountTransactionBody.verify|verify} messages. + * @param m TokenFreezeAccountTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenFreezeAccountTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenFreezeAccountTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenFreezeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenFreezeAccountTransactionBody; + + /** + * Gets the default type url for TokenFreezeAccountTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_freeze_account_transaction.js b/packages/proto/src/minimal/token_freeze_account_transaction.js new file mode 100644 index 0000000000..14c285e2bf --- /dev/null +++ b/packages/proto/src/minimal/token_freeze_account_transaction.js @@ -0,0 +1,11132 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_freeze_account_transaction || ($protobuf.roots.hashgraph_token_freeze_account_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token account freezing. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenFreezeAccountTransactionBody|null} [tokenFreeze] Freeze an account with respect to a token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token account freezing. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Freeze an account with respect to a token. + * @member {proto.ITokenFreezeAccountTransactionBody|null|undefined} tokenFreeze + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenFreeze = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenFreeze"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenFreeze"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenFreeze != null && Object.hasOwnProperty.call(m, "tokenFreeze")) + $root.proto.TokenFreezeAccountTransactionBody.encode(m.tokenFreeze, w.uint32(186).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 23: { + m.tokenFreeze = $root.proto.TokenFreezeAccountTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenFreezeAccountTransactionBody = (function() { + + /** + * Properties of a TokenFreezeAccountTransactionBody. + * @memberof proto + * @interface ITokenFreezeAccountTransactionBody + * @property {proto.ITokenID|null} [token] The token for which this account will be frozen. + * @property {proto.IAccountID|null} [account] The account to be frozen. + */ + + /** + * Constructs a new TokenFreezeAccountTransactionBody. + * @memberof proto + * @classdesc Freezes transfers of the specified token for the account. + * @implements ITokenFreezeAccountTransactionBody + * @constructor + * @param {proto.ITokenFreezeAccountTransactionBody=} [p] Properties to set + */ + function TokenFreezeAccountTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which this account will be frozen. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenFreezeAccountTransactionBody + * @instance + */ + TokenFreezeAccountTransactionBody.prototype.token = null; + + /** + * The account to be frozen. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenFreezeAccountTransactionBody + * @instance + */ + TokenFreezeAccountTransactionBody.prototype.account = null; + + /** + * Creates a new TokenFreezeAccountTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenFreezeAccountTransactionBody + * @static + * @param {proto.ITokenFreezeAccountTransactionBody=} [properties] Properties to set + * @returns {proto.TokenFreezeAccountTransactionBody} TokenFreezeAccountTransactionBody instance + */ + TokenFreezeAccountTransactionBody.create = function create(properties) { + return new TokenFreezeAccountTransactionBody(properties); + }; + + /** + * Encodes the specified TokenFreezeAccountTransactionBody message. Does not implicitly {@link proto.TokenFreezeAccountTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenFreezeAccountTransactionBody + * @static + * @param {proto.ITokenFreezeAccountTransactionBody} m TokenFreezeAccountTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenFreezeAccountTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenFreezeAccountTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenFreezeAccountTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenFreezeAccountTransactionBody} TokenFreezeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenFreezeAccountTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenFreezeAccountTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenFreezeAccountTransactionBody + * @function getTypeUrl + * @memberof proto.TokenFreezeAccountTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenFreezeAccountTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenFreezeAccountTransactionBody"; + }; + + return TokenFreezeAccountTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_grant_kyc_transaction.d.ts b/packages/proto/src/minimal/token_grant_kyc_transaction.d.ts new file mode 100644 index 0000000000..e6eb0cf382 --- /dev/null +++ b/packages/proto/src/minimal/token_grant_kyc_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_grant_kyc_transaction; + +declare namespace hashgraph_token_grant_kyc_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token KYC granting. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Grant KYC to an account with respect to a token. */ + tokenGrantKyc?: (proto.ITokenGrantKycTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token KYC granting. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Grant KYC to an account with respect to a token. */ + public tokenGrantKyc?: (proto.ITokenGrantKycTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenGrantKyc"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenGrantKycTransactionBody. */ + interface ITokenGrantKycTransactionBody { + + /** The token for which this account will be granted KYC. */ + token?: (proto.ITokenID|null); + + /** The account to be KYCed. */ + account?: (proto.IAccountID|null); + } + + /** Grants KYC to the account for the given token. */ + class TokenGrantKycTransactionBody implements ITokenGrantKycTransactionBody { + + /** + * Constructs a new TokenGrantKycTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenGrantKycTransactionBody); + + /** The token for which this account will be granted KYC. */ + public token?: (proto.ITokenID|null); + + /** The account to be KYCed. */ + public account?: (proto.IAccountID|null); + + /** + * Creates a new TokenGrantKycTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenGrantKycTransactionBody instance + */ + public static create(properties?: proto.ITokenGrantKycTransactionBody): proto.TokenGrantKycTransactionBody; + + /** + * Encodes the specified TokenGrantKycTransactionBody message. Does not implicitly {@link proto.TokenGrantKycTransactionBody.verify|verify} messages. + * @param m TokenGrantKycTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenGrantKycTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenGrantKycTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenGrantKycTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenGrantKycTransactionBody; + + /** + * Gets the default type url for TokenGrantKycTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_grant_kyc_transaction.js b/packages/proto/src/minimal/token_grant_kyc_transaction.js new file mode 100644 index 0000000000..562e1ee361 --- /dev/null +++ b/packages/proto/src/minimal/token_grant_kyc_transaction.js @@ -0,0 +1,11132 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_grant_kyc_transaction || ($protobuf.roots.hashgraph_token_grant_kyc_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token KYC granting. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenGrantKycTransactionBody|null} [tokenGrantKyc] Grant KYC to an account with respect to a token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token KYC granting. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Grant KYC to an account with respect to a token. + * @member {proto.ITokenGrantKycTransactionBody|null|undefined} tokenGrantKyc + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenGrantKyc = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenGrantKyc"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenGrantKyc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenGrantKyc != null && Object.hasOwnProperty.call(m, "tokenGrantKyc")) + $root.proto.TokenGrantKycTransactionBody.encode(m.tokenGrantKyc, w.uint32(202).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 25: { + m.tokenGrantKyc = $root.proto.TokenGrantKycTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenGrantKycTransactionBody = (function() { + + /** + * Properties of a TokenGrantKycTransactionBody. + * @memberof proto + * @interface ITokenGrantKycTransactionBody + * @property {proto.ITokenID|null} [token] The token for which this account will be granted KYC. + * @property {proto.IAccountID|null} [account] The account to be KYCed. + */ + + /** + * Constructs a new TokenGrantKycTransactionBody. + * @memberof proto + * @classdesc Grants KYC to the account for the given token. + * @implements ITokenGrantKycTransactionBody + * @constructor + * @param {proto.ITokenGrantKycTransactionBody=} [p] Properties to set + */ + function TokenGrantKycTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which this account will be granted KYC. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenGrantKycTransactionBody + * @instance + */ + TokenGrantKycTransactionBody.prototype.token = null; + + /** + * The account to be KYCed. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenGrantKycTransactionBody + * @instance + */ + TokenGrantKycTransactionBody.prototype.account = null; + + /** + * Creates a new TokenGrantKycTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenGrantKycTransactionBody + * @static + * @param {proto.ITokenGrantKycTransactionBody=} [properties] Properties to set + * @returns {proto.TokenGrantKycTransactionBody} TokenGrantKycTransactionBody instance + */ + TokenGrantKycTransactionBody.create = function create(properties) { + return new TokenGrantKycTransactionBody(properties); + }; + + /** + * Encodes the specified TokenGrantKycTransactionBody message. Does not implicitly {@link proto.TokenGrantKycTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenGrantKycTransactionBody + * @static + * @param {proto.ITokenGrantKycTransactionBody} m TokenGrantKycTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenGrantKycTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenGrantKycTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenGrantKycTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenGrantKycTransactionBody} TokenGrantKycTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenGrantKycTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenGrantKycTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenGrantKycTransactionBody + * @function getTypeUrl + * @memberof proto.TokenGrantKycTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenGrantKycTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenGrantKycTransactionBody"; + }; + + return TokenGrantKycTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_mint_transaction.d.ts b/packages/proto/src/minimal/token_mint_transaction.d.ts new file mode 100644 index 0000000000..9827b7d3c3 --- /dev/null +++ b/packages/proto/src/minimal/token_mint_transaction.d.ts @@ -0,0 +1,6471 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_mint_transaction; + +declare namespace hashgraph_token_mint_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + bodyBytes?: (Uint8Array|null); + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** Represents a Transaction. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** + * Replaced with `signedTransactionBytes`.
+ * The body of the transaction. + */ + public body?: (proto.ITransactionBody|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * The signatures on the body with a newer format. + */ + public sigMap?: (proto.ISignatureMap|null); + + /** + * Replaced with `signedTransactionBytes`.
+ * TransactionBody serialized into bytes. + */ + public bodyBytes: Uint8Array; + + /** + * A valid, serialized, `SignedTransaction` message. + *

+ * This field MUST be present. + * This field MUST NOT exceed the current network transaction size limit + * (currently 6144 bytes). + */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Mint new tokens. */ + tokenMint?: (proto.ITokenMintTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token minting. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Mint new tokens. */ + public tokenMint?: (proto.ITokenMintTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenMint"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenMintTransactionBody. */ + interface ITokenMintTransactionBody { + + /** The token for which to mint tokens. */ + token?: (proto.ITokenID|null); + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to mint to the Treasury Account. + */ + amount?: (Long|null); + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * A list of metadata that are being created. + */ + metadata?: (Uint8Array[]|null); + } + + /** Mints tokens to the Token's treasury Account. */ + class TokenMintTransactionBody implements ITokenMintTransactionBody { + + /** + * Constructs a new TokenMintTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenMintTransactionBody); + + /** The token for which to mint tokens. */ + public token?: (proto.ITokenID|null); + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. + * The amount to mint to the Treasury Account. + */ + public amount: Long; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. + * A list of metadata that are being created. + */ + public metadata: Uint8Array[]; + + /** + * Creates a new TokenMintTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenMintTransactionBody instance + */ + public static create(properties?: proto.ITokenMintTransactionBody): proto.TokenMintTransactionBody; + + /** + * Encodes the specified TokenMintTransactionBody message. Does not implicitly {@link proto.TokenMintTransactionBody.verify|verify} messages. + * @param m TokenMintTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenMintTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenMintTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenMintTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenMintTransactionBody; + + /** + * Gets the default type url for TokenMintTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_mint_transaction.js b/packages/proto/src/minimal/token_mint_transaction.js new file mode 100644 index 0000000000..0a637bd271 --- /dev/null +++ b/packages/proto/src/minimal/token_mint_transaction.js @@ -0,0 +1,9025 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_mint_transaction || ($protobuf.roots.hashgraph_token_mint_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.SignedTransaction = (function() { + + /** + * Properties of a SignedTransaction. + * @memberof proto + * @interface ISignedTransaction + * @property {Uint8Array|null} [bodyBytes] A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + * @property {proto.ISignatureMap|null} [sigMap] A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + */ + + /** + * Constructs a new SignedTransaction. + * @memberof proto + * @classdesc A combination transaction bytes and a map of signatures.
+ * This message contains a serialized `TransactionBody` in a byte array + * and a `SignatureMap` that contains all of the signatures offered to + * authenticate the transaction. + * + * ### Block Stream Effects + * This content is recorded in the record stream exactly as received. + * @implements ISignedTransaction + * @constructor + * @param {proto.ISignedTransaction=} [p] Properties to set + */ + function SignedTransaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + * @member {Uint8Array} bodyBytes + * @memberof proto.SignedTransaction + * @instance + */ + SignedTransaction.prototype.bodyBytes = $util.newBuffer([]); + + /** + * A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + * @member {proto.ISignatureMap|null|undefined} sigMap + * @memberof proto.SignedTransaction + * @instance + */ + SignedTransaction.prototype.sigMap = null; + + /** + * Creates a new SignedTransaction instance using the specified properties. + * @function create + * @memberof proto.SignedTransaction + * @static + * @param {proto.ISignedTransaction=} [properties] Properties to set + * @returns {proto.SignedTransaction} SignedTransaction instance + */ + SignedTransaction.create = function create(properties) { + return new SignedTransaction(properties); + }; + + /** + * Encodes the specified SignedTransaction message. Does not implicitly {@link proto.SignedTransaction.verify|verify} messages. + * @function encode + * @memberof proto.SignedTransaction + * @static + * @param {proto.ISignedTransaction} m SignedTransaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedTransaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) + w.uint32(10).bytes(m.bodyBytes); + if (m.sigMap != null && Object.hasOwnProperty.call(m, "sigMap")) + $root.proto.SignatureMap.encode(m.sigMap, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a SignedTransaction message from the specified reader or buffer. + * @function decode + * @memberof proto.SignedTransaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignedTransaction} SignedTransaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedTransaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignedTransaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.bodyBytes = r.bytes(); + break; + } + case 2: { + m.sigMap = $root.proto.SignatureMap.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignedTransaction + * @function getTypeUrl + * @memberof proto.SignedTransaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignedTransaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignedTransaction"; + }; + + return SignedTransaction; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_pause_transaction.d.ts b/packages/proto/src/minimal/token_pause_transaction.d.ts new file mode 100644 index 0000000000..2cd473ecea --- /dev/null +++ b/packages/proto/src/minimal/token_pause_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_pause_transaction; + +declare namespace hashgraph_token_pause_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token pausing. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Pause a Token. */ + tokenPause?: (proto.ITokenPauseTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token pausing. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Pause a Token. */ + public tokenPause?: (proto.ITokenPauseTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenPause"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenPauseTransactionBody. */ + interface ITokenPauseTransactionBody { + + /** The token to be paused. */ + token?: (proto.ITokenID|null); + } + + /** Pauses the Token from being involved in any kind of Transaction until it is unpaused. */ + class TokenPauseTransactionBody implements ITokenPauseTransactionBody { + + /** + * Constructs a new TokenPauseTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenPauseTransactionBody); + + /** The token to be paused. */ + public token?: (proto.ITokenID|null); + + /** + * Creates a new TokenPauseTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenPauseTransactionBody instance + */ + public static create(properties?: proto.ITokenPauseTransactionBody): proto.TokenPauseTransactionBody; + + /** + * Encodes the specified TokenPauseTransactionBody message. Does not implicitly {@link proto.TokenPauseTransactionBody.verify|verify} messages. + * @param m TokenPauseTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenPauseTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenPauseTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenPauseTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenPauseTransactionBody; + + /** + * Gets the default type url for TokenPauseTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_pause_transaction.js b/packages/proto/src/minimal/token_pause_transaction.js new file mode 100644 index 0000000000..29aeef7abc --- /dev/null +++ b/packages/proto/src/minimal/token_pause_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_pause_transaction || ($protobuf.roots.hashgraph_token_pause_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token pausing. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenPauseTransactionBody|null} [tokenPause] Pause a Token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token pausing. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Pause a Token. + * @member {proto.ITokenPauseTransactionBody|null|undefined} tokenPause + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenPause = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenPause"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenPause"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenPause != null && Object.hasOwnProperty.call(m, "tokenPause")) + $root.proto.TokenPauseTransactionBody.encode(m.tokenPause, w.uint32(282).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 35: { + m.tokenPause = $root.proto.TokenPauseTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenPauseTransactionBody = (function() { + + /** + * Properties of a TokenPauseTransactionBody. + * @memberof proto + * @interface ITokenPauseTransactionBody + * @property {proto.ITokenID|null} [token] The token to be paused. + */ + + /** + * Constructs a new TokenPauseTransactionBody. + * @memberof proto + * @classdesc Pauses the Token from being involved in any kind of Transaction until it is unpaused. + * @implements ITokenPauseTransactionBody + * @constructor + * @param {proto.ITokenPauseTransactionBody=} [p] Properties to set + */ + function TokenPauseTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token to be paused. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenPauseTransactionBody + * @instance + */ + TokenPauseTransactionBody.prototype.token = null; + + /** + * Creates a new TokenPauseTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenPauseTransactionBody + * @static + * @param {proto.ITokenPauseTransactionBody=} [properties] Properties to set + * @returns {proto.TokenPauseTransactionBody} TokenPauseTransactionBody instance + */ + TokenPauseTransactionBody.create = function create(properties) { + return new TokenPauseTransactionBody(properties); + }; + + /** + * Encodes the specified TokenPauseTransactionBody message. Does not implicitly {@link proto.TokenPauseTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenPauseTransactionBody + * @static + * @param {proto.ITokenPauseTransactionBody} m TokenPauseTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenPauseTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenPauseTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenPauseTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenPauseTransactionBody} TokenPauseTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenPauseTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenPauseTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenPauseTransactionBody + * @function getTypeUrl + * @memberof proto.TokenPauseTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenPauseTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenPauseTransactionBody"; + }; + + return TokenPauseTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_reject_transaction.d.ts b/packages/proto/src/minimal/token_reject_transaction.d.ts new file mode 100644 index 0000000000..3c7cebdbd6 --- /dev/null +++ b/packages/proto/src/minimal/token_reject_transaction.d.ts @@ -0,0 +1,6454 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_reject_transaction; + +declare namespace hashgraph_token_reject_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token reject. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenReference. */ + interface ITokenReference { + + /** A fungible/common token type. */ + fungibleToken?: (proto.ITokenID|null); + + /** A single specific serialized non-fungible/unique token. */ + nft?: (proto.INftID|null); + } + + /** A union token identifier. */ + class TokenReference implements ITokenReference { + + /** + * Constructs a new TokenReference. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenReference); + + /** A fungible/common token type. */ + public fungibleToken?: (proto.ITokenID|null); + + /** A single specific serialized non-fungible/unique token. */ + public nft?: (proto.INftID|null); + + /** TokenReference tokenIdentifier. */ + public tokenIdentifier?: ("fungibleToken"|"nft"); + + /** + * Creates a new TokenReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenReference instance + */ + public static create(properties?: proto.ITokenReference): proto.TokenReference; + + /** + * Encodes the specified TokenReference message. Does not implicitly {@link proto.TokenReference.verify|verify} messages. + * @param m TokenReference message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenReference, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenReference message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenReference; + + /** + * Gets the default type url for TokenReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRejectTransactionBody. */ + interface ITokenRejectTransactionBody { + + /** An account identifier. */ + owner?: (proto.IAccountID|null); + + /** A list of one or more token rejections. */ + rejections?: (proto.ITokenReference[]|null); + } + + /** Reject undesired token(s). */ + class TokenRejectTransactionBody implements ITokenRejectTransactionBody { + + /** + * Constructs a new TokenRejectTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRejectTransactionBody); + + /** An account identifier. */ + public owner?: (proto.IAccountID|null); + + /** A list of one or more token rejections. */ + public rejections: proto.ITokenReference[]; + + /** + * Creates a new TokenRejectTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRejectTransactionBody instance + */ + public static create(properties?: proto.ITokenRejectTransactionBody): proto.TokenRejectTransactionBody; + + /** + * Encodes the specified TokenRejectTransactionBody message. Does not implicitly {@link proto.TokenRejectTransactionBody.verify|verify} messages. + * @param m TokenRejectTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRejectTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRejectTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRejectTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRejectTransactionBody; + + /** + * Gets the default type url for TokenRejectTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Reject and return a token to treasury. */ + tokenReject?: (proto.ITokenRejectTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token reject. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Reject and return a token to treasury. */ + public tokenReject?: (proto.ITokenRejectTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenReject"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_reject_transaction.js b/packages/proto/src/minimal/token_reject_transaction.js new file mode 100644 index 0000000000..78729eced2 --- /dev/null +++ b/packages/proto/src/minimal/token_reject_transaction.js @@ -0,0 +1,11275 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_reject_transaction || ($protobuf.roots.hashgraph_token_reject_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token reject. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TokenReference = (function() { + + /** + * Properties of a TokenReference. + * @memberof proto + * @interface ITokenReference + * @property {proto.ITokenID|null} [fungibleToken] A fungible/common token type. + * @property {proto.INftID|null} [nft] A single specific serialized non-fungible/unique token. + */ + + /** + * Constructs a new TokenReference. + * @memberof proto + * @classdesc A union token identifier. + * @implements ITokenReference + * @constructor + * @param {proto.ITokenReference=} [p] Properties to set + */ + function TokenReference(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fungible/common token type. + * @member {proto.ITokenID|null|undefined} fungibleToken + * @memberof proto.TokenReference + * @instance + */ + TokenReference.prototype.fungibleToken = null; + + /** + * A single specific serialized non-fungible/unique token. + * @member {proto.INftID|null|undefined} nft + * @memberof proto.TokenReference + * @instance + */ + TokenReference.prototype.nft = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TokenReference tokenIdentifier. + * @member {"fungibleToken"|"nft"|undefined} tokenIdentifier + * @memberof proto.TokenReference + * @instance + */ + Object.defineProperty(TokenReference.prototype, "tokenIdentifier", { + get: $util.oneOfGetter($oneOfFields = ["fungibleToken", "nft"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TokenReference instance using the specified properties. + * @function create + * @memberof proto.TokenReference + * @static + * @param {proto.ITokenReference=} [properties] Properties to set + * @returns {proto.TokenReference} TokenReference instance + */ + TokenReference.create = function create(properties) { + return new TokenReference(properties); + }; + + /** + * Encodes the specified TokenReference message. Does not implicitly {@link proto.TokenReference.verify|verify} messages. + * @function encode + * @memberof proto.TokenReference + * @static + * @param {proto.ITokenReference} m TokenReference message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenReference.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fungibleToken != null && Object.hasOwnProperty.call(m, "fungibleToken")) + $root.proto.TokenID.encode(m.fungibleToken, w.uint32(10).fork()).ldelim(); + if (m.nft != null && Object.hasOwnProperty.call(m, "nft")) + $root.proto.NftID.encode(m.nft, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenReference message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenReference + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenReference} TokenReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenReference.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenReference(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fungibleToken = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.nft = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenReference + * @function getTypeUrl + * @memberof proto.TokenReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenReference"; + }; + + return TokenReference; + })(); + + proto.TokenRejectTransactionBody = (function() { + + /** + * Properties of a TokenRejectTransactionBody. + * @memberof proto + * @interface ITokenRejectTransactionBody + * @property {proto.IAccountID|null} [owner] An account identifier. + * @property {Array.|null} [rejections] A list of one or more token rejections. + */ + + /** + * Constructs a new TokenRejectTransactionBody. + * @memberof proto + * @classdesc Reject undesired token(s). + * @implements ITokenRejectTransactionBody + * @constructor + * @param {proto.ITokenRejectTransactionBody=} [p] Properties to set + */ + function TokenRejectTransactionBody(p) { + this.rejections = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier. + * @member {proto.IAccountID|null|undefined} owner + * @memberof proto.TokenRejectTransactionBody + * @instance + */ + TokenRejectTransactionBody.prototype.owner = null; + + /** + * A list of one or more token rejections. + * @member {Array.} rejections + * @memberof proto.TokenRejectTransactionBody + * @instance + */ + TokenRejectTransactionBody.prototype.rejections = $util.emptyArray; + + /** + * Creates a new TokenRejectTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenRejectTransactionBody + * @static + * @param {proto.ITokenRejectTransactionBody=} [properties] Properties to set + * @returns {proto.TokenRejectTransactionBody} TokenRejectTransactionBody instance + */ + TokenRejectTransactionBody.create = function create(properties) { + return new TokenRejectTransactionBody(properties); + }; + + /** + * Encodes the specified TokenRejectTransactionBody message. Does not implicitly {@link proto.TokenRejectTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenRejectTransactionBody + * @static + * @param {proto.ITokenRejectTransactionBody} m TokenRejectTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRejectTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.owner != null && Object.hasOwnProperty.call(m, "owner")) + $root.proto.AccountID.encode(m.owner, w.uint32(10).fork()).ldelim(); + if (m.rejections != null && m.rejections.length) { + for (var i = 0; i < m.rejections.length; ++i) + $root.proto.TokenReference.encode(m.rejections[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenRejectTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRejectTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRejectTransactionBody} TokenRejectTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRejectTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRejectTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.owner = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.rejections && m.rejections.length)) + m.rejections = []; + m.rejections.push($root.proto.TokenReference.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRejectTransactionBody + * @function getTypeUrl + * @memberof proto.TokenRejectTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRejectTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRejectTransactionBody"; + }; + + return TokenRejectTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenRejectTransactionBody|null} [tokenReject] Reject and return a token to treasury. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token reject. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Reject and return a token to treasury. + * @member {proto.ITokenRejectTransactionBody|null|undefined} tokenReject + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenReject = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenReject"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenReject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenReject != null && Object.hasOwnProperty.call(m, "tokenReject")) + $root.proto.TokenRejectTransactionBody.encode(m.tokenReject, w.uint32(458).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 57: { + m.tokenReject = $root.proto.TokenRejectTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_revoke_kyc_transaction.d.ts b/packages/proto/src/minimal/token_revoke_kyc_transaction.d.ts new file mode 100644 index 0000000000..5fa2083148 --- /dev/null +++ b/packages/proto/src/minimal/token_revoke_kyc_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_revoke_kyc_transaction; + +declare namespace hashgraph_token_revoke_kyc_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token KYC revoking. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Revoke KYC from an account with respect to a token. */ + tokenRevokeKyc?: (proto.ITokenRevokeKycTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token KYC revoking. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Revoke KYC from an account with respect to a token. */ + public tokenRevokeKyc?: (proto.ITokenRevokeKycTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenRevokeKyc"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRevokeKycTransactionBody. */ + interface ITokenRevokeKycTransactionBody { + + /** The token for which this account will be revoked of its KYC. */ + token?: (proto.ITokenID|null); + + /** The account to be revoked of its KYC. */ + account?: (proto.IAccountID|null); + } + + /** Revokes KYC to the account for the given token. */ + class TokenRevokeKycTransactionBody implements ITokenRevokeKycTransactionBody { + + /** + * Constructs a new TokenRevokeKycTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRevokeKycTransactionBody); + + /** The token for which this account will be revoked of its KYC. */ + public token?: (proto.ITokenID|null); + + /** The account to be revoked of its KYC. */ + public account?: (proto.IAccountID|null); + + /** + * Creates a new TokenRevokeKycTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRevokeKycTransactionBody instance + */ + public static create(properties?: proto.ITokenRevokeKycTransactionBody): proto.TokenRevokeKycTransactionBody; + + /** + * Encodes the specified TokenRevokeKycTransactionBody message. Does not implicitly {@link proto.TokenRevokeKycTransactionBody.verify|verify} messages. + * @param m TokenRevokeKycTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRevokeKycTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRevokeKycTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRevokeKycTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRevokeKycTransactionBody; + + /** + * Gets the default type url for TokenRevokeKycTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_revoke_kyc_transaction.js b/packages/proto/src/minimal/token_revoke_kyc_transaction.js new file mode 100644 index 0000000000..d6e98f8555 --- /dev/null +++ b/packages/proto/src/minimal/token_revoke_kyc_transaction.js @@ -0,0 +1,11132 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_revoke_kyc_transaction || ($protobuf.roots.hashgraph_token_revoke_kyc_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token KYC revoking. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenRevokeKycTransactionBody|null} [tokenRevokeKyc] Revoke KYC from an account with respect to a token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token KYC revoking. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Revoke KYC from an account with respect to a token. + * @member {proto.ITokenRevokeKycTransactionBody|null|undefined} tokenRevokeKyc + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenRevokeKyc = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenRevokeKyc"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenRevokeKyc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenRevokeKyc != null && Object.hasOwnProperty.call(m, "tokenRevokeKyc")) + $root.proto.TokenRevokeKycTransactionBody.encode(m.tokenRevokeKyc, w.uint32(210).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 26: { + m.tokenRevokeKyc = $root.proto.TokenRevokeKycTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenRevokeKycTransactionBody = (function() { + + /** + * Properties of a TokenRevokeKycTransactionBody. + * @memberof proto + * @interface ITokenRevokeKycTransactionBody + * @property {proto.ITokenID|null} [token] The token for which this account will be revoked of its KYC. + * @property {proto.IAccountID|null} [account] The account to be revoked of its KYC. + */ + + /** + * Constructs a new TokenRevokeKycTransactionBody. + * @memberof proto + * @classdesc Revokes KYC to the account for the given token. + * @implements ITokenRevokeKycTransactionBody + * @constructor + * @param {proto.ITokenRevokeKycTransactionBody=} [p] Properties to set + */ + function TokenRevokeKycTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which this account will be revoked of its KYC. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenRevokeKycTransactionBody + * @instance + */ + TokenRevokeKycTransactionBody.prototype.token = null; + + /** + * The account to be revoked of its KYC. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenRevokeKycTransactionBody + * @instance + */ + TokenRevokeKycTransactionBody.prototype.account = null; + + /** + * Creates a new TokenRevokeKycTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenRevokeKycTransactionBody + * @static + * @param {proto.ITokenRevokeKycTransactionBody=} [properties] Properties to set + * @returns {proto.TokenRevokeKycTransactionBody} TokenRevokeKycTransactionBody instance + */ + TokenRevokeKycTransactionBody.create = function create(properties) { + return new TokenRevokeKycTransactionBody(properties); + }; + + /** + * Encodes the specified TokenRevokeKycTransactionBody message. Does not implicitly {@link proto.TokenRevokeKycTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenRevokeKycTransactionBody + * @static + * @param {proto.ITokenRevokeKycTransactionBody} m TokenRevokeKycTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRevokeKycTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenRevokeKycTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRevokeKycTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRevokeKycTransactionBody} TokenRevokeKycTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRevokeKycTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRevokeKycTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRevokeKycTransactionBody + * @function getTypeUrl + * @memberof proto.TokenRevokeKycTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRevokeKycTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRevokeKycTransactionBody"; + }; + + return TokenRevokeKycTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_unfreeze_account_transaction.d.ts b/packages/proto/src/minimal/token_unfreeze_account_transaction.d.ts new file mode 100644 index 0000000000..671cc015d9 --- /dev/null +++ b/packages/proto/src/minimal/token_unfreeze_account_transaction.d.ts @@ -0,0 +1,6393 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_unfreeze_account_transaction; + +declare namespace hashgraph_token_unfreeze_account_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token account unfreezing. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Unfreeze an account with respect to a token. */ + tokenUnfreeze?: (proto.ITokenUnfreezeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token account unfreezing. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Unfreeze an account with respect to a token. */ + public tokenUnfreeze?: (proto.ITokenUnfreezeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenUnfreeze"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenUnfreezeAccountTransactionBody. */ + interface ITokenUnfreezeAccountTransactionBody { + + /** The token for which this account will be unfrozen. */ + token?: (proto.ITokenID|null); + + /** The account to be unfrozen. */ + account?: (proto.IAccountID|null); + } + + /** Unfreezes transfers of the specified token for the account. */ + class TokenUnfreezeAccountTransactionBody implements ITokenUnfreezeAccountTransactionBody { + + /** + * Constructs a new TokenUnfreezeAccountTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenUnfreezeAccountTransactionBody); + + /** The token for which this account will be unfrozen. */ + public token?: (proto.ITokenID|null); + + /** The account to be unfrozen. */ + public account?: (proto.IAccountID|null); + + /** + * Creates a new TokenUnfreezeAccountTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenUnfreezeAccountTransactionBody instance + */ + public static create(properties?: proto.ITokenUnfreezeAccountTransactionBody): proto.TokenUnfreezeAccountTransactionBody; + + /** + * Encodes the specified TokenUnfreezeAccountTransactionBody message. Does not implicitly {@link proto.TokenUnfreezeAccountTransactionBody.verify|verify} messages. + * @param m TokenUnfreezeAccountTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenUnfreezeAccountTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenUnfreezeAccountTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenUnfreezeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenUnfreezeAccountTransactionBody; + + /** + * Gets the default type url for TokenUnfreezeAccountTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_unfreeze_account_transaction.js b/packages/proto/src/minimal/token_unfreeze_account_transaction.js new file mode 100644 index 0000000000..09285d5275 --- /dev/null +++ b/packages/proto/src/minimal/token_unfreeze_account_transaction.js @@ -0,0 +1,11132 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_unfreeze_account_transaction || ($protobuf.roots.hashgraph_token_unfreeze_account_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token account unfreezing. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenUnfreezeAccountTransactionBody|null} [tokenUnfreeze] Unfreeze an account with respect to a token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token account unfreezing. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Unfreeze an account with respect to a token. + * @member {proto.ITokenUnfreezeAccountTransactionBody|null|undefined} tokenUnfreeze + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenUnfreeze = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenUnfreeze"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenUnfreeze"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenUnfreeze != null && Object.hasOwnProperty.call(m, "tokenUnfreeze")) + $root.proto.TokenUnfreezeAccountTransactionBody.encode(m.tokenUnfreeze, w.uint32(194).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 24: { + m.tokenUnfreeze = $root.proto.TokenUnfreezeAccountTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenUnfreezeAccountTransactionBody = (function() { + + /** + * Properties of a TokenUnfreezeAccountTransactionBody. + * @memberof proto + * @interface ITokenUnfreezeAccountTransactionBody + * @property {proto.ITokenID|null} [token] The token for which this account will be unfrozen. + * @property {proto.IAccountID|null} [account] The account to be unfrozen. + */ + + /** + * Constructs a new TokenUnfreezeAccountTransactionBody. + * @memberof proto + * @classdesc Unfreezes transfers of the specified token for the account. + * @implements ITokenUnfreezeAccountTransactionBody + * @constructor + * @param {proto.ITokenUnfreezeAccountTransactionBody=} [p] Properties to set + */ + function TokenUnfreezeAccountTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which this account will be unfrozen. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @instance + */ + TokenUnfreezeAccountTransactionBody.prototype.token = null; + + /** + * The account to be unfrozen. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @instance + */ + TokenUnfreezeAccountTransactionBody.prototype.account = null; + + /** + * Creates a new TokenUnfreezeAccountTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @static + * @param {proto.ITokenUnfreezeAccountTransactionBody=} [properties] Properties to set + * @returns {proto.TokenUnfreezeAccountTransactionBody} TokenUnfreezeAccountTransactionBody instance + */ + TokenUnfreezeAccountTransactionBody.create = function create(properties) { + return new TokenUnfreezeAccountTransactionBody(properties); + }; + + /** + * Encodes the specified TokenUnfreezeAccountTransactionBody message. Does not implicitly {@link proto.TokenUnfreezeAccountTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @static + * @param {proto.ITokenUnfreezeAccountTransactionBody} m TokenUnfreezeAccountTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenUnfreezeAccountTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenUnfreezeAccountTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenUnfreezeAccountTransactionBody} TokenUnfreezeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenUnfreezeAccountTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenUnfreezeAccountTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenUnfreezeAccountTransactionBody + * @function getTypeUrl + * @memberof proto.TokenUnfreezeAccountTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenUnfreezeAccountTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenUnfreezeAccountTransactionBody"; + }; + + return TokenUnfreezeAccountTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_unpause_transaction.d.ts b/packages/proto/src/minimal/token_unpause_transaction.d.ts new file mode 100644 index 0000000000..604be937ec --- /dev/null +++ b/packages/proto/src/minimal/token_unpause_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_unpause_transaction; + +declare namespace hashgraph_token_unpause_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token unpausing. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Unpause a Token. */ + tokenUnpause?: (proto.ITokenUnpauseTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token unpausing. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Unpause a Token. */ + public tokenUnpause?: (proto.ITokenUnpauseTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenUnpause"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenUnpauseTransactionBody. */ + interface ITokenUnpauseTransactionBody { + + /** The token to be unpaused. */ + token?: (proto.ITokenID|null); + } + + /** Unpauses the Token from being paused. */ + class TokenUnpauseTransactionBody implements ITokenUnpauseTransactionBody { + + /** + * Constructs a new TokenUnpauseTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenUnpauseTransactionBody); + + /** The token to be unpaused. */ + public token?: (proto.ITokenID|null); + + /** + * Creates a new TokenUnpauseTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenUnpauseTransactionBody instance + */ + public static create(properties?: proto.ITokenUnpauseTransactionBody): proto.TokenUnpauseTransactionBody; + + /** + * Encodes the specified TokenUnpauseTransactionBody message. Does not implicitly {@link proto.TokenUnpauseTransactionBody.verify|verify} messages. + * @param m TokenUnpauseTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenUnpauseTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenUnpauseTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenUnpauseTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenUnpauseTransactionBody; + + /** + * Gets the default type url for TokenUnpauseTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_unpause_transaction.js b/packages/proto/src/minimal/token_unpause_transaction.js new file mode 100644 index 0000000000..01410998d6 --- /dev/null +++ b/packages/proto/src/minimal/token_unpause_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_unpause_transaction || ($protobuf.roots.hashgraph_token_unpause_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token unpausing. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenUnpauseTransactionBody|null} [tokenUnpause] Unpause a Token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token unpausing. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Unpause a Token. + * @member {proto.ITokenUnpauseTransactionBody|null|undefined} tokenUnpause + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenUnpause = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenUnpause"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenUnpause"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenUnpause != null && Object.hasOwnProperty.call(m, "tokenUnpause")) + $root.proto.TokenUnpauseTransactionBody.encode(m.tokenUnpause, w.uint32(290).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 36: { + m.tokenUnpause = $root.proto.TokenUnpauseTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenUnpauseTransactionBody = (function() { + + /** + * Properties of a TokenUnpauseTransactionBody. + * @memberof proto + * @interface ITokenUnpauseTransactionBody + * @property {proto.ITokenID|null} [token] The token to be unpaused. + */ + + /** + * Constructs a new TokenUnpauseTransactionBody. + * @memberof proto + * @classdesc Unpauses the Token from being paused. + * @implements ITokenUnpauseTransactionBody + * @constructor + * @param {proto.ITokenUnpauseTransactionBody=} [p] Properties to set + */ + function TokenUnpauseTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token to be unpaused. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenUnpauseTransactionBody + * @instance + */ + TokenUnpauseTransactionBody.prototype.token = null; + + /** + * Creates a new TokenUnpauseTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenUnpauseTransactionBody + * @static + * @param {proto.ITokenUnpauseTransactionBody=} [properties] Properties to set + * @returns {proto.TokenUnpauseTransactionBody} TokenUnpauseTransactionBody instance + */ + TokenUnpauseTransactionBody.create = function create(properties) { + return new TokenUnpauseTransactionBody(properties); + }; + + /** + * Encodes the specified TokenUnpauseTransactionBody message. Does not implicitly {@link proto.TokenUnpauseTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenUnpauseTransactionBody + * @static + * @param {proto.ITokenUnpauseTransactionBody} m TokenUnpauseTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenUnpauseTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenUnpauseTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenUnpauseTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenUnpauseTransactionBody} TokenUnpauseTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenUnpauseTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenUnpauseTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenUnpauseTransactionBody + * @function getTypeUrl + * @memberof proto.TokenUnpauseTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenUnpauseTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenUnpauseTransactionBody"; + }; + + return TokenUnpauseTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_update_nfts_transaction.d.ts b/packages/proto/src/minimal/token_update_nfts_transaction.d.ts new file mode 100644 index 0000000000..4b64385e68 --- /dev/null +++ b/packages/proto/src/minimal/token_update_nfts_transaction.d.ts @@ -0,0 +1,6451 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_update_nfts_transaction; + +declare namespace hashgraph_token_update_nfts_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token update NFTs. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** A wrapper for optional bytes values. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: proto.IBytesValue): proto.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link proto.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenUpdateNftsTransactionBody. */ + interface ITokenUpdateNftsTransactionBody { + + /** A token identifier. */ + token?: (proto.ITokenID|null); + + /** A list of serial numbers to be updated. */ + serialNumbers?: (Long[]|null); + + /** A new value for the metadata. */ + metadata?: (proto.IBytesValue|null); + } + + /** Modify the metadata field for individual non-fungible tokens. */ + class TokenUpdateNftsTransactionBody implements ITokenUpdateNftsTransactionBody { + + /** + * Constructs a new TokenUpdateNftsTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenUpdateNftsTransactionBody); + + /** A token identifier. */ + public token?: (proto.ITokenID|null); + + /** A list of serial numbers to be updated. */ + public serialNumbers: Long[]; + + /** A new value for the metadata. */ + public metadata?: (proto.IBytesValue|null); + + /** + * Creates a new TokenUpdateNftsTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenUpdateNftsTransactionBody instance + */ + public static create(properties?: proto.ITokenUpdateNftsTransactionBody): proto.TokenUpdateNftsTransactionBody; + + /** + * Encodes the specified TokenUpdateNftsTransactionBody message. Does not implicitly {@link proto.TokenUpdateNftsTransactionBody.verify|verify} messages. + * @param m TokenUpdateNftsTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenUpdateNftsTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenUpdateNftsTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenUpdateNftsTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenUpdateNftsTransactionBody; + + /** + * Gets the default type url for TokenUpdateNftsTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update one or more non-fungible tokens. */ + tokenUpdateNfts?: (proto.ITokenUpdateNftsTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token update NFTs. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update one or more non-fungible tokens. */ + public tokenUpdateNfts?: (proto.ITokenUpdateNftsTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenUpdateNfts"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_update_nfts_transaction.js b/packages/proto/src/minimal/token_update_nfts_transaction.js new file mode 100644 index 0000000000..3e9fda7fc5 --- /dev/null +++ b/packages/proto/src/minimal/token_update_nfts_transaction.js @@ -0,0 +1,11268 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_update_nfts_transaction || ($protobuf.roots.hashgraph_token_update_nfts_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token update NFTs. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof proto + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof proto + * @classdesc A wrapper for optional bytes values. + * @implements IBytesValue + * @constructor + * @param {proto.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof proto.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof proto.BytesValue + * @static + * @param {proto.IBytesValue=} [properties] Properties to set + * @returns {proto.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link proto.BytesValue.verify|verify} messages. + * @function encode + * @memberof proto.BytesValue + * @static + * @param {proto.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof proto.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof proto.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.BytesValue"; + }; + + return BytesValue; + })(); + + proto.TokenUpdateNftsTransactionBody = (function() { + + /** + * Properties of a TokenUpdateNftsTransactionBody. + * @memberof proto + * @interface ITokenUpdateNftsTransactionBody + * @property {proto.ITokenID|null} [token] A token identifier. + * @property {Array.|null} [serialNumbers] A list of serial numbers to be updated. + * @property {proto.IBytesValue|null} [metadata] A new value for the metadata. + */ + + /** + * Constructs a new TokenUpdateNftsTransactionBody. + * @memberof proto + * @classdesc Modify the metadata field for individual non-fungible tokens. + * @implements ITokenUpdateNftsTransactionBody + * @constructor + * @param {proto.ITokenUpdateNftsTransactionBody=} [p] Properties to set + */ + function TokenUpdateNftsTransactionBody(p) { + this.serialNumbers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenUpdateNftsTransactionBody + * @instance + */ + TokenUpdateNftsTransactionBody.prototype.token = null; + + /** + * A list of serial numbers to be updated. + * @member {Array.} serialNumbers + * @memberof proto.TokenUpdateNftsTransactionBody + * @instance + */ + TokenUpdateNftsTransactionBody.prototype.serialNumbers = $util.emptyArray; + + /** + * A new value for the metadata. + * @member {proto.IBytesValue|null|undefined} metadata + * @memberof proto.TokenUpdateNftsTransactionBody + * @instance + */ + TokenUpdateNftsTransactionBody.prototype.metadata = null; + + /** + * Creates a new TokenUpdateNftsTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenUpdateNftsTransactionBody + * @static + * @param {proto.ITokenUpdateNftsTransactionBody=} [properties] Properties to set + * @returns {proto.TokenUpdateNftsTransactionBody} TokenUpdateNftsTransactionBody instance + */ + TokenUpdateNftsTransactionBody.create = function create(properties) { + return new TokenUpdateNftsTransactionBody(properties); + }; + + /** + * Encodes the specified TokenUpdateNftsTransactionBody message. Does not implicitly {@link proto.TokenUpdateNftsTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenUpdateNftsTransactionBody + * @static + * @param {proto.ITokenUpdateNftsTransactionBody} m TokenUpdateNftsTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenUpdateNftsTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.serialNumbers != null && m.serialNumbers.length) { + w.uint32(18).fork(); + for (var i = 0; i < m.serialNumbers.length; ++i) + w.int64(m.serialNumbers[i]); + w.ldelim(); + } + if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata")) + $root.proto.BytesValue.encode(m.metadata, w.uint32(26).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenUpdateNftsTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenUpdateNftsTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenUpdateNftsTransactionBody} TokenUpdateNftsTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenUpdateNftsTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenUpdateNftsTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.serialNumbers && m.serialNumbers.length)) + m.serialNumbers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.serialNumbers.push(r.int64()); + } else + m.serialNumbers.push(r.int64()); + break; + } + case 3: { + m.metadata = $root.proto.BytesValue.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenUpdateNftsTransactionBody + * @function getTypeUrl + * @memberof proto.TokenUpdateNftsTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenUpdateNftsTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenUpdateNftsTransactionBody"; + }; + + return TokenUpdateNftsTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenUpdateNftsTransactionBody|null} [tokenUpdateNfts] Update one or more non-fungible tokens. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token update NFTs. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update one or more non-fungible tokens. + * @member {proto.ITokenUpdateNftsTransactionBody|null|undefined} tokenUpdateNfts + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenUpdateNfts = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenUpdateNfts"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenUpdateNfts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenUpdateNfts != null && Object.hasOwnProperty.call(m, "tokenUpdateNfts")) + $root.proto.TokenUpdateNftsTransactionBody.encode(m.tokenUpdateNfts, w.uint32(426).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 53: { + m.tokenUpdateNfts = $root.proto.TokenUpdateNftsTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_update_transaction.d.ts b/packages/proto/src/minimal/token_update_transaction.d.ts new file mode 100644 index 0000000000..2187e5a9b6 --- /dev/null +++ b/packages/proto/src/minimal/token_update_transaction.d.ts @@ -0,0 +1,6483 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_update_transaction; + +declare namespace hashgraph_token_update_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token updates. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Update an Hedera token. */ + tokenUpdate?: (proto.ITokenUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token updates. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Update an Hedera token. */ + public tokenUpdate?: (proto.ITokenUpdateTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenUpdate"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenUpdateTransactionBody. */ + interface ITokenUpdateTransactionBody { + + /** The Token to be updated. */ + token?: (proto.ITokenID|null); + + /** The new publicly visible token symbol. */ + symbol?: (string|null); + + /** The new publicly visible name of the token. */ + name?: (string|null); + + /** The new Treasury account of the Token. */ + treasury?: (proto.IAccountID|null); + + /** The new admin key of the Token. */ + adminKey?: (proto.IKey|null); + + /** The new KYC key of the Token. */ + kycKey?: (proto.IKey|null); + + /** The new Freeze key of the Token. */ + freezeKey?: (proto.IKey|null); + + /** The new Wipe key of the Token. */ + wipeKey?: (proto.IKey|null); + + /** The new Supply key of the Token. */ + supplyKey?: (proto.IKey|null); + + /** The new account which will be automatically charged to renew the token's expiration. */ + autoRenewAccount?: (proto.IAccountID|null); + + /** The new interval at which the auto-renew account will be charged to extend the token's expiry. */ + autoRenewPeriod?: (proto.IDuration|null); + + /** The new expiry time of the token. */ + expiry?: (proto.ITimestamp|null); + + /** If set, the new memo to be associated with the token. */ + memo?: (string|null); + + /** If set, the new key to use to update the token's custom fee schedule. */ + feeScheduleKey?: (proto.IKey|null); + + /** If set, the new key that can pause and unpause the Token. */ + pauseKey?: (proto.IKey|null); + + /** The new metadata of the token. */ + metadata?: (Uint8Array|null); + + /** The new key which can update the metadata of a token. */ + metadataKey?: (proto.IKey|null); + } + + /** At consensus, updates an already created token to the given values. */ + class TokenUpdateTransactionBody implements ITokenUpdateTransactionBody { + + /** + * Constructs a new TokenUpdateTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenUpdateTransactionBody); + + /** The Token to be updated. */ + public token?: (proto.ITokenID|null); + + /** The new publicly visible token symbol. */ + public symbol: string; + + /** The new publicly visible name of the token. */ + public name: string; + + /** The new Treasury account of the Token. */ + public treasury?: (proto.IAccountID|null); + + /** The new admin key of the Token. */ + public adminKey?: (proto.IKey|null); + + /** The new KYC key of the Token. */ + public kycKey?: (proto.IKey|null); + + /** The new Freeze key of the Token. */ + public freezeKey?: (proto.IKey|null); + + /** The new Wipe key of the Token. */ + public wipeKey?: (proto.IKey|null); + + /** The new Supply key of the Token. */ + public supplyKey?: (proto.IKey|null); + + /** The new account which will be automatically charged to renew the token's expiration. */ + public autoRenewAccount?: (proto.IAccountID|null); + + /** The new interval at which the auto-renew account will be charged to extend the token's expiry. */ + public autoRenewPeriod?: (proto.IDuration|null); + + /** The new expiry time of the token. */ + public expiry?: (proto.ITimestamp|null); + + /** If set, the new memo to be associated with the token. */ + public memo: string; + + /** If set, the new key to use to update the token's custom fee schedule. */ + public feeScheduleKey?: (proto.IKey|null); + + /** If set, the new key that can pause and unpause the Token. */ + public pauseKey?: (proto.IKey|null); + + /** The new metadata of the token. */ + public metadata: Uint8Array; + + /** The new key which can update the metadata of a token. */ + public metadataKey?: (proto.IKey|null); + + /** + * Creates a new TokenUpdateTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenUpdateTransactionBody instance + */ + public static create(properties?: proto.ITokenUpdateTransactionBody): proto.TokenUpdateTransactionBody; + + /** + * Encodes the specified TokenUpdateTransactionBody message. Does not implicitly {@link proto.TokenUpdateTransactionBody.verify|verify} messages. + * @param m TokenUpdateTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenUpdateTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenUpdateTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenUpdateTransactionBody; + + /** + * Gets the default type url for TokenUpdateTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_update_transaction.js b/packages/proto/src/minimal/token_update_transaction.js new file mode 100644 index 0000000000..e4eda0e3cb --- /dev/null +++ b/packages/proto/src/minimal/token_update_transaction.js @@ -0,0 +1,11357 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_update_transaction || ($protobuf.roots.hashgraph_token_update_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token updates. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenUpdateTransactionBody|null} [tokenUpdate] Update an Hedera token. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token updates. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Update an Hedera token. + * @member {proto.ITokenUpdateTransactionBody|null|undefined} tokenUpdate + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenUpdate = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenUpdate"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenUpdate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenUpdate != null && Object.hasOwnProperty.call(m, "tokenUpdate")) + $root.proto.TokenUpdateTransactionBody.encode(m.tokenUpdate, w.uint32(226).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 28: { + m.tokenUpdate = $root.proto.TokenUpdateTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenUpdateTransactionBody = (function() { + + /** + * Properties of a TokenUpdateTransactionBody. + * @memberof proto + * @interface ITokenUpdateTransactionBody + * @property {proto.ITokenID|null} [token] The Token to be updated. + * @property {string|null} [symbol] The new publicly visible token symbol. + * @property {string|null} [name] The new publicly visible name of the token. + * @property {proto.IAccountID|null} [treasury] The new Treasury account of the Token. + * @property {proto.IKey|null} [adminKey] The new admin key of the Token. + * @property {proto.IKey|null} [kycKey] The new KYC key of the Token. + * @property {proto.IKey|null} [freezeKey] The new Freeze key of the Token. + * @property {proto.IKey|null} [wipeKey] The new Wipe key of the Token. + * @property {proto.IKey|null} [supplyKey] The new Supply key of the Token. + * @property {proto.IAccountID|null} [autoRenewAccount] The new account which will be automatically charged to renew the token's expiration. + * @property {proto.IDuration|null} [autoRenewPeriod] The new interval at which the auto-renew account will be charged to extend the token's expiry. + * @property {proto.ITimestamp|null} [expiry] The new expiry time of the token. + * @property {string|null} [memo] If set, the new memo to be associated with the token. + * @property {proto.IKey|null} [feeScheduleKey] If set, the new key to use to update the token's custom fee schedule. + * @property {proto.IKey|null} [pauseKey] If set, the new key that can pause and unpause the Token. + * @property {Uint8Array|null} [metadata] The new metadata of the token. + * @property {proto.IKey|null} [metadataKey] The new key which can update the metadata of a token. + */ + + /** + * Constructs a new TokenUpdateTransactionBody. + * @memberof proto + * @classdesc At consensus, updates an already created token to the given values. + * @implements ITokenUpdateTransactionBody + * @constructor + * @param {proto.ITokenUpdateTransactionBody=} [p] Properties to set + */ + function TokenUpdateTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The Token to be updated. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.token = null; + + /** + * The new publicly visible token symbol. + * @member {string} symbol + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.symbol = ""; + + /** + * The new publicly visible name of the token. + * @member {string} name + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.name = ""; + + /** + * The new Treasury account of the Token. + * @member {proto.IAccountID|null|undefined} treasury + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.treasury = null; + + /** + * The new admin key of the Token. + * @member {proto.IKey|null|undefined} adminKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.adminKey = null; + + /** + * The new KYC key of the Token. + * @member {proto.IKey|null|undefined} kycKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.kycKey = null; + + /** + * The new Freeze key of the Token. + * @member {proto.IKey|null|undefined} freezeKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.freezeKey = null; + + /** + * The new Wipe key of the Token. + * @member {proto.IKey|null|undefined} wipeKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.wipeKey = null; + + /** + * The new Supply key of the Token. + * @member {proto.IKey|null|undefined} supplyKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.supplyKey = null; + + /** + * The new account which will be automatically charged to renew the token's expiration. + * @member {proto.IAccountID|null|undefined} autoRenewAccount + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.autoRenewAccount = null; + + /** + * The new interval at which the auto-renew account will be charged to extend the token's expiry. + * @member {proto.IDuration|null|undefined} autoRenewPeriod + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.autoRenewPeriod = null; + + /** + * The new expiry time of the token. + * @member {proto.ITimestamp|null|undefined} expiry + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.expiry = null; + + /** + * If set, the new memo to be associated with the token. + * @member {string} memo + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.memo = ""; + + /** + * If set, the new key to use to update the token's custom fee schedule. + * @member {proto.IKey|null|undefined} feeScheduleKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.feeScheduleKey = null; + + /** + * If set, the new key that can pause and unpause the Token. + * @member {proto.IKey|null|undefined} pauseKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.pauseKey = null; + + /** + * The new metadata of the token. + * @member {Uint8Array} metadata + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.metadata = $util.newBuffer([]); + + /** + * The new key which can update the metadata of a token. + * @member {proto.IKey|null|undefined} metadataKey + * @memberof proto.TokenUpdateTransactionBody + * @instance + */ + TokenUpdateTransactionBody.prototype.metadataKey = null; + + /** + * Creates a new TokenUpdateTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenUpdateTransactionBody + * @static + * @param {proto.ITokenUpdateTransactionBody=} [properties] Properties to set + * @returns {proto.TokenUpdateTransactionBody} TokenUpdateTransactionBody instance + */ + TokenUpdateTransactionBody.create = function create(properties) { + return new TokenUpdateTransactionBody(properties); + }; + + /** + * Encodes the specified TokenUpdateTransactionBody message. Does not implicitly {@link proto.TokenUpdateTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenUpdateTransactionBody + * @static + * @param {proto.ITokenUpdateTransactionBody} m TokenUpdateTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenUpdateTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(26).string(m.name); + if (m.treasury != null && Object.hasOwnProperty.call(m, "treasury")) + $root.proto.AccountID.encode(m.treasury, w.uint32(34).fork()).ldelim(); + if (m.adminKey != null && Object.hasOwnProperty.call(m, "adminKey")) + $root.proto.Key.encode(m.adminKey, w.uint32(42).fork()).ldelim(); + if (m.kycKey != null && Object.hasOwnProperty.call(m, "kycKey")) + $root.proto.Key.encode(m.kycKey, w.uint32(50).fork()).ldelim(); + if (m.freezeKey != null && Object.hasOwnProperty.call(m, "freezeKey")) + $root.proto.Key.encode(m.freezeKey, w.uint32(58).fork()).ldelim(); + if (m.wipeKey != null && Object.hasOwnProperty.call(m, "wipeKey")) + $root.proto.Key.encode(m.wipeKey, w.uint32(66).fork()).ldelim(); + if (m.supplyKey != null && Object.hasOwnProperty.call(m, "supplyKey")) + $root.proto.Key.encode(m.supplyKey, w.uint32(74).fork()).ldelim(); + if (m.autoRenewAccount != null && Object.hasOwnProperty.call(m, "autoRenewAccount")) + $root.proto.AccountID.encode(m.autoRenewAccount, w.uint32(82).fork()).ldelim(); + if (m.autoRenewPeriod != null && Object.hasOwnProperty.call(m, "autoRenewPeriod")) + $root.proto.Duration.encode(m.autoRenewPeriod, w.uint32(90).fork()).ldelim(); + if (m.expiry != null && Object.hasOwnProperty.call(m, "expiry")) + $root.proto.Timestamp.encode(m.expiry, w.uint32(98).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(106).string(m.memo); + if (m.feeScheduleKey != null && Object.hasOwnProperty.call(m, "feeScheduleKey")) + $root.proto.Key.encode(m.feeScheduleKey, w.uint32(114).fork()).ldelim(); + if (m.pauseKey != null && Object.hasOwnProperty.call(m, "pauseKey")) + $root.proto.Key.encode(m.pauseKey, w.uint32(122).fork()).ldelim(); + if (m.metadata != null && Object.hasOwnProperty.call(m, "metadata")) + w.uint32(130).bytes(m.metadata); + if (m.metadataKey != null && Object.hasOwnProperty.call(m, "metadataKey")) + $root.proto.Key.encode(m.metadataKey, w.uint32(138).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenUpdateTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenUpdateTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenUpdateTransactionBody} TokenUpdateTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenUpdateTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenUpdateTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.name = r.string(); + break; + } + case 4: { + m.treasury = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.adminKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 6: { + m.kycKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 7: { + m.freezeKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 8: { + m.wipeKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 9: { + m.supplyKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 10: { + m.autoRenewAccount = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 11: { + m.autoRenewPeriod = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 12: { + m.expiry = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 13: { + m.memo = r.string(); + break; + } + case 14: { + m.feeScheduleKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 15: { + m.pauseKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 16: { + m.metadata = r.bytes(); + break; + } + case 17: { + m.metadataKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenUpdateTransactionBody + * @function getTypeUrl + * @memberof proto.TokenUpdateTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenUpdateTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenUpdateTransactionBody"; + }; + + return TokenUpdateTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/token_wipe_account_transaction.d.ts b/packages/proto/src/minimal/token_wipe_account_transaction.d.ts new file mode 100644 index 0000000000..e849e25c75 --- /dev/null +++ b/packages/proto/src/minimal/token_wipe_account_transaction.d.ts @@ -0,0 +1,6405 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_token_wipe_account_transaction; + +declare namespace hashgraph_token_wipe_account_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for token wiping. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Wipe tokens from an account. */ + tokenWipe?: (proto.ITokenWipeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for token wiping. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Wipe tokens from an account. */ + public tokenWipe?: (proto.ITokenWipeAccountTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "tokenWipe"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenWipeAccountTransactionBody. */ + interface ITokenWipeAccountTransactionBody { + + /** The token for which the account will be wiped. */ + token?: (proto.ITokenID|null); + + /** The account to be wiped. */ + account?: (proto.IAccountID|null); + + /** Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe. */ + amount?: (Long|null); + + /** Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. */ + serialNumbers?: (Long[]|null); + } + + /** Wipes the provided amount of tokens from the specified Account. */ + class TokenWipeAccountTransactionBody implements ITokenWipeAccountTransactionBody { + + /** + * Constructs a new TokenWipeAccountTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenWipeAccountTransactionBody); + + /** The token for which the account will be wiped. */ + public token?: (proto.ITokenID|null); + + /** The account to be wiped. */ + public account?: (proto.IAccountID|null); + + /** Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe. */ + public amount: Long; + + /** Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. */ + public serialNumbers: Long[]; + + /** + * Creates a new TokenWipeAccountTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenWipeAccountTransactionBody instance + */ + public static create(properties?: proto.ITokenWipeAccountTransactionBody): proto.TokenWipeAccountTransactionBody; + + /** + * Encodes the specified TokenWipeAccountTransactionBody message. Does not implicitly {@link proto.TokenWipeAccountTransactionBody.verify|verify} messages. + * @param m TokenWipeAccountTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenWipeAccountTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenWipeAccountTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenWipeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenWipeAccountTransactionBody; + + /** + * Gets the default type url for TokenWipeAccountTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/token_wipe_account_transaction.js b/packages/proto/src/minimal/token_wipe_account_transaction.js new file mode 100644 index 0000000000..178c3cc209 --- /dev/null +++ b/packages/proto/src/minimal/token_wipe_account_transaction.js @@ -0,0 +1,11174 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_token_wipe_account_transaction || ($protobuf.roots.hashgraph_token_wipe_account_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for token wiping. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.ITokenWipeAccountTransactionBody|null} [tokenWipe] Wipe tokens from an account. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for token wiping. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Wipe tokens from an account. + * @member {proto.ITokenWipeAccountTransactionBody|null|undefined} tokenWipe + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.tokenWipe = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"tokenWipe"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["tokenWipe"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.tokenWipe != null && Object.hasOwnProperty.call(m, "tokenWipe")) + $root.proto.TokenWipeAccountTransactionBody.encode(m.tokenWipe, w.uint32(250).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 31: { + m.tokenWipe = $root.proto.TokenWipeAccountTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.TokenWipeAccountTransactionBody = (function() { + + /** + * Properties of a TokenWipeAccountTransactionBody. + * @memberof proto + * @interface ITokenWipeAccountTransactionBody + * @property {proto.ITokenID|null} [token] The token for which the account will be wiped. + * @property {proto.IAccountID|null} [account] The account to be wiped. + * @property {Long|null} [amount] Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe. + * @property {Array.|null} [serialNumbers] Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. + */ + + /** + * Constructs a new TokenWipeAccountTransactionBody. + * @memberof proto + * @classdesc Wipes the provided amount of tokens from the specified Account. + * @implements ITokenWipeAccountTransactionBody + * @constructor + * @param {proto.ITokenWipeAccountTransactionBody=} [p] Properties to set + */ + function TokenWipeAccountTransactionBody(p) { + this.serialNumbers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The token for which the account will be wiped. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenWipeAccountTransactionBody + * @instance + */ + TokenWipeAccountTransactionBody.prototype.token = null; + + /** + * The account to be wiped. + * @member {proto.IAccountID|null|undefined} account + * @memberof proto.TokenWipeAccountTransactionBody + * @instance + */ + TokenWipeAccountTransactionBody.prototype.account = null; + + /** + * Applicable to tokens of type FUNGIBLE_COMMON. The amount of tokens to wipe. + * @member {Long} amount + * @memberof proto.TokenWipeAccountTransactionBody + * @instance + */ + TokenWipeAccountTransactionBody.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Applicable to tokens of type NON_FUNGIBLE_UNIQUE. The list of serial numbers to be wiped. + * @member {Array.} serialNumbers + * @memberof proto.TokenWipeAccountTransactionBody + * @instance + */ + TokenWipeAccountTransactionBody.prototype.serialNumbers = $util.emptyArray; + + /** + * Creates a new TokenWipeAccountTransactionBody instance using the specified properties. + * @function create + * @memberof proto.TokenWipeAccountTransactionBody + * @static + * @param {proto.ITokenWipeAccountTransactionBody=} [properties] Properties to set + * @returns {proto.TokenWipeAccountTransactionBody} TokenWipeAccountTransactionBody instance + */ + TokenWipeAccountTransactionBody.create = function create(properties) { + return new TokenWipeAccountTransactionBody(properties); + }; + + /** + * Encodes the specified TokenWipeAccountTransactionBody message. Does not implicitly {@link proto.TokenWipeAccountTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TokenWipeAccountTransactionBody + * @static + * @param {proto.ITokenWipeAccountTransactionBody} m TokenWipeAccountTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenWipeAccountTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.account != null && Object.hasOwnProperty.call(m, "account")) + $root.proto.AccountID.encode(m.account, w.uint32(18).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(24).uint64(m.amount); + if (m.serialNumbers != null && m.serialNumbers.length) { + w.uint32(34).fork(); + for (var i = 0; i < m.serialNumbers.length; ++i) + w.int64(m.serialNumbers[i]); + w.ldelim(); + } + return w; + }; + + /** + * Decodes a TokenWipeAccountTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenWipeAccountTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenWipeAccountTransactionBody} TokenWipeAccountTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenWipeAccountTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenWipeAccountTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.account = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.amount = r.uint64(); + break; + } + case 4: { + if (!(m.serialNumbers && m.serialNumbers.length)) + m.serialNumbers = []; + if ((t & 7) === 2) { + var c2 = r.uint32() + r.pos; + while (r.pos < c2) + m.serialNumbers.push(r.int64()); + } else + m.serialNumbers.push(r.int64()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenWipeAccountTransactionBody + * @function getTypeUrl + * @memberof proto.TokenWipeAccountTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenWipeAccountTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenWipeAccountTransactionBody"; + }; + + return TokenWipeAccountTransactionBody; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/transaction_contents.d.ts b/packages/proto/src/minimal/transaction_contents.d.ts new file mode 100644 index 0000000000..1feea704ba --- /dev/null +++ b/packages/proto/src/minimal/transaction_contents.d.ts @@ -0,0 +1,5178 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = transaction_contents; + +declare namespace transaction_contents { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a SignedTransaction. */ + interface ISignedTransaction { + + /** + * A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + */ + bodyBytes?: (Uint8Array|null); + + /** + * A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + */ + sigMap?: (proto.ISignatureMap|null); + } + + /** + * A combination transaction bytes and a map of signatures.
+ * This message contains a serialized `TransactionBody` in a byte array + * and a `SignatureMap` that contains all of the signatures offered to + * authenticate the transaction. + * + * ### Block Stream Effects + * This content is recorded in the record stream exactly as received. + */ + class SignedTransaction implements ISignedTransaction { + + /** + * Constructs a new SignedTransaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignedTransaction); + + /** + * A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + */ + public bodyBytes: Uint8Array; + + /** + * A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + */ + public sigMap?: (proto.ISignatureMap|null); + + /** + * Creates a new SignedTransaction instance using the specified properties. + * @param [properties] Properties to set + * @returns SignedTransaction instance + */ + public static create(properties?: proto.ISignedTransaction): proto.SignedTransaction; + + /** + * Encodes the specified SignedTransaction message. Does not implicitly {@link proto.SignedTransaction.verify|verify} messages. + * @param m SignedTransaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignedTransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignedTransaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignedTransaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignedTransaction; + + /** + * Gets the default type url for SignedTransaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/transaction_contents.js b/packages/proto/src/minimal/transaction_contents.js new file mode 100644 index 0000000000..33024e5b65 --- /dev/null +++ b/packages/proto/src/minimal/transaction_contents.js @@ -0,0 +1,9025 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.transaction_contents || ($protobuf.roots.transaction_contents = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.SignedTransaction = (function() { + + /** + * Properties of a SignedTransaction. + * @memberof proto + * @interface ISignedTransaction + * @property {Uint8Array|null} [bodyBytes] A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + * @property {proto.ISignatureMap|null} [sigMap] A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + */ + + /** + * Constructs a new SignedTransaction. + * @memberof proto + * @classdesc A combination transaction bytes and a map of signatures.
+ * This message contains a serialized `TransactionBody` in a byte array + * and a `SignatureMap` that contains all of the signatures offered to + * authenticate the transaction. + * + * ### Block Stream Effects + * This content is recorded in the record stream exactly as received. + * @implements ISignedTransaction + * @constructor + * @param {proto.ISignedTransaction=} [p] Properties to set + */ + function SignedTransaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A byte array containing a serialized `TransactionBody`. + *

+ * This content is what the signatures in `sigMap` MUST sign. + * @member {Uint8Array} bodyBytes + * @memberof proto.SignedTransaction + * @instance + */ + SignedTransaction.prototype.bodyBytes = $util.newBuffer([]); + + /** + * A set of cryptographic signatures. + *

+ * This set MUST contain all signatures required to authenticate + * and authorize the transaction.
+ * This set MAY contain additional signatures. + * @member {proto.ISignatureMap|null|undefined} sigMap + * @memberof proto.SignedTransaction + * @instance + */ + SignedTransaction.prototype.sigMap = null; + + /** + * Creates a new SignedTransaction instance using the specified properties. + * @function create + * @memberof proto.SignedTransaction + * @static + * @param {proto.ISignedTransaction=} [properties] Properties to set + * @returns {proto.SignedTransaction} SignedTransaction instance + */ + SignedTransaction.create = function create(properties) { + return new SignedTransaction(properties); + }; + + /** + * Encodes the specified SignedTransaction message. Does not implicitly {@link proto.SignedTransaction.verify|verify} messages. + * @function encode + * @memberof proto.SignedTransaction + * @static + * @param {proto.ISignedTransaction} m SignedTransaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedTransaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.bodyBytes != null && Object.hasOwnProperty.call(m, "bodyBytes")) + w.uint32(10).bytes(m.bodyBytes); + if (m.sigMap != null && Object.hasOwnProperty.call(m, "sigMap")) + $root.proto.SignatureMap.encode(m.sigMap, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a SignedTransaction message from the specified reader or buffer. + * @function decode + * @memberof proto.SignedTransaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignedTransaction} SignedTransaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedTransaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignedTransaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.bodyBytes = r.bytes(); + break; + } + case 2: { + m.sigMap = $root.proto.SignatureMap.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignedTransaction + * @function getTypeUrl + * @memberof proto.SignedTransaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignedTransaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignedTransaction"; + }; + + return SignedTransaction; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/transaction_respone.js b/packages/proto/src/minimal/transaction_respone.js new file mode 100644 index 0000000000..7dba0fe2b8 --- /dev/null +++ b/packages/proto/src/minimal/transaction_respone.js @@ -0,0 +1,2277 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.transaction_response || ($protobuf.roots.transaction_response = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.TransactionResponse = (function() { + + /** + * Properties of a TransactionResponse. + * @memberof proto + * @interface ITransactionResponse + * @property {proto.ResponseCodeEnum|null} [nodeTransactionPrecheckCode] A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + * @property {Long|null} [cost] An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + */ + + /** + * Constructs a new TransactionResponse. + * @memberof proto + * @classdesc A message sent by a node in response to a transaction submission.
+ * This message only acknowledges that the individual node has checked + * the transaction, completed pre-check, and checked the fee offered. + * + * If the transaction fee is not sufficient, the `nodeTransactionPrecheckCode` + * value SHALL be `INSUFFICIENT_TX_FEE` and the `cost` field SHALL be the + * actual transaction fee, in tinybar, required.
+ * If the client requires acknowledgement of the network consensus result + * for a transaction, the client SHOULD request a transaction receipt or + * detailed transaction record. A client MAY also obtain network consensus + * results from a mirror node. + * @implements ITransactionResponse + * @constructor + * @param {proto.ITransactionResponse=} [p] Properties to set + */ + function TransactionResponse(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + * @member {proto.ResponseCodeEnum} nodeTransactionPrecheckCode + * @memberof proto.TransactionResponse + * @instance + */ + TransactionResponse.prototype.nodeTransactionPrecheckCode = 0; + + /** + * An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + * @member {Long} cost + * @memberof proto.TransactionResponse + * @instance + */ + TransactionResponse.prototype.cost = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TransactionResponse instance using the specified properties. + * @function create + * @memberof proto.TransactionResponse + * @static + * @param {proto.ITransactionResponse=} [properties] Properties to set + * @returns {proto.TransactionResponse} TransactionResponse instance + */ + TransactionResponse.create = function create(properties) { + return new TransactionResponse(properties); + }; + + /** + * Encodes the specified TransactionResponse message. Does not implicitly {@link proto.TransactionResponse.verify|verify} messages. + * @function encode + * @memberof proto.TransactionResponse + * @static + * @param {proto.ITransactionResponse} m TransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionResponse.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeTransactionPrecheckCode != null && Object.hasOwnProperty.call(m, "nodeTransactionPrecheckCode")) + w.uint32(8).int32(m.nodeTransactionPrecheckCode); + if (m.cost != null && Object.hasOwnProperty.call(m, "cost")) + w.uint32(16).uint64(m.cost); + return w; + }; + + /** + * Decodes a TransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionResponse} TransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionResponse.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionResponse(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodeTransactionPrecheckCode = r.int32(); + break; + } + case 2: { + m.cost = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionResponse + * @function getTypeUrl + * @memberof proto.TransactionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionResponse"; + }; + + return TransactionResponse; + })(); + + /** + * An enumeration of possible response codes. + * @name proto.ResponseCodeEnum + * @enum {number} + * @property {number} OK=0 The transaction passed the precheck validations. + * @property {number} INVALID_TRANSACTION=1 For any error not handled by specific error codes listed below. + * @property {number} PAYER_ACCOUNT_NOT_FOUND=2 Payer account does not exist. + * @property {number} INVALID_NODE_ACCOUNT=3 Node Account provided does not match the node account of the node the transaction was submitted + * to. + * @property {number} TRANSACTION_EXPIRED=4 Pre-Check error when TransactionValidStart + transactionValidDuration is less than current + * consensus time. + * @property {number} INVALID_TRANSACTION_START=5 Transaction start time is greater than current consensus time + * @property {number} INVALID_TRANSACTION_DURATION=6 The given transactionValidDuration was either non-positive, or greater than the maximum + * valid duration of 180 secs. + * @property {number} INVALID_SIGNATURE=7 The transaction signature is not valid + * @property {number} MEMO_TOO_LONG=8 Transaction memo size exceeded 100 bytes + * @property {number} INSUFFICIENT_TX_FEE=9 The fee provided in the transaction is insufficient for this type of transaction + * @property {number} INSUFFICIENT_PAYER_BALANCE=10 The payer account has insufficient cryptocurrency to pay the transaction fee + * @property {number} 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) + * @property {number} BUSY=12 If API is throttled out + * @property {number} NOT_SUPPORTED=13 The API is not currently supported + * @property {number} INVALID_FILE_ID=14 The file id is invalid or does not exist + * @property {number} INVALID_ACCOUNT_ID=15 The account id is invalid or does not exist + * @property {number} INVALID_CONTRACT_ID=16 The contract id is invalid or does not exist + * @property {number} INVALID_TRANSACTION_ID=17 Transaction id is not valid + * @property {number} RECEIPT_NOT_FOUND=18 Receipt for given transaction id does not exist + * @property {number} RECORD_NOT_FOUND=19 Record for given transaction id does not exist + * @property {number} INVALID_SOLIDITY_ID=20 The solidity id is invalid or entity with this solidity id does not exist + * @property {number} UNKNOWN=21 The responding node has submitted the transaction to the network. Its final status is still + * unknown. + * @property {number} SUCCESS=22 The transaction succeeded + * @property {number} FAIL_INVALID=23 There was a system error and the transaction failed because of invalid request parameters. + * @property {number} FAIL_FEE=24 There was a system error while performing fee calculation, reserved for future. + * @property {number} FAIL_BALANCE=25 There was a system error while performing balance checks, reserved for future. + * @property {number} KEY_REQUIRED=26 Key not provided in the transaction body + * @property {number} BAD_ENCODING=27 Unsupported algorithm/encoding used for keys in the transaction + * @property {number} INSUFFICIENT_ACCOUNT_BALANCE=28 When the account balance is not sufficient for the transfer + * @property {number} INVALID_SOLIDITY_ADDRESS=29 During an update transaction when the system is not able to find the Users Solidity address + * @property {number} INSUFFICIENT_GAS=30 Not enough gas was supplied to execute transaction + * @property {number} CONTRACT_SIZE_LIMIT_EXCEEDED=31 contract byte code size is over the limit + * @property {number} LOCAL_CALL_MODIFICATION_EXCEPTION=32 local execution (query) is requested for a function which changes state + * @property {number} CONTRACT_REVERT_EXECUTED=33 Contract REVERT OPCODE executed + * @property {number} CONTRACT_EXECUTION_EXCEPTION=34 For any contract execution related error not handled by specific error codes listed above. + * @property {number} 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 + * @property {number} MISSING_QUERY_HEADER=36 Header is missing in Query request + * @property {number} ACCOUNT_UPDATE_FAILED=37 The update of the account failed + * @property {number} INVALID_KEY_ENCODING=38 Provided key encoding was not supported by the system + * @property {number} NULL_SOLIDITY_ADDRESS=39 null solidity address + * @property {number} CONTRACT_UPDATE_FAILED=40 update of the contract failed + * @property {number} INVALID_QUERY_HEADER=41 the query header is invalid + * @property {number} INVALID_FEE_SUBMITTED=42 Invalid fee submitted + * @property {number} INVALID_PAYER_SIGNATURE=43 Payer signature is invalid + * @property {number} KEY_NOT_PROVIDED=44 The keys were not provided in the request. + * @property {number} INVALID_EXPIRATION_TIME=45 Expiration time provided in the transaction was invalid. + * @property {number} NO_WACL_KEY=46 WriteAccess Control Keys are not provided for the file + * @property {number} FILE_CONTENT_EMPTY=47 The contents of file are provided as empty. + * @property {number} INVALID_ACCOUNT_AMOUNTS=48 The crypto transfer credit and debit do not sum equal to 0 + * @property {number} EMPTY_TRANSACTION_BODY=49 Transaction body provided is empty + * @property {number} INVALID_TRANSACTION_BODY=50 Invalid transaction body provided + * @property {number} 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) + * @property {number} 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. + * @property {number} EMPTY_LIVE_HASH_BODY=53 the livehash body is empty + * @property {number} EMPTY_LIVE_HASH=54 the livehash data is missing + * @property {number} EMPTY_LIVE_HASH_KEYS=55 the keys for a livehash are missing + * @property {number} INVALID_LIVE_HASH_SIZE=56 the livehash data is not the output of a SHA-384 digest + * @property {number} EMPTY_QUERY_BODY=57 the query body is empty + * @property {number} EMPTY_LIVE_HASH_QUERY=58 the crypto livehash query is empty + * @property {number} LIVE_HASH_NOT_FOUND=59 the livehash is not present + * @property {number} ACCOUNT_ID_DOES_NOT_EXIST=60 the account id passed has not yet been created. + * @property {number} LIVE_HASH_ALREADY_EXISTS=61 the livehash already exists for a given account + * @property {number} INVALID_FILE_WACL=62 File WACL keys are invalid + * @property {number} SERIALIZATION_FAILED=63 Serialization failure + * @property {number} TRANSACTION_OVERSIZE=64 The size of the Transaction is greater than transactionMaxBytes + * @property {number} TRANSACTION_TOO_MANY_LAYERS=65 The Transaction has more than 50 levels + * @property {number} CONTRACT_DELETED=66 Contract is marked as deleted + * @property {number} PLATFORM_NOT_ACTIVE=67 the platform node is either disconnected or lagging behind. + * @property {number} KEY_PREFIX_MISMATCH=68 one public key matches more than one prefixes on the signature map + * @property {number} PLATFORM_TRANSACTION_NOT_CREATED=69 transaction not created by platform due to large backlog + * @property {number} INVALID_RENEWAL_PERIOD=70 auto renewal period is not a positive number of seconds + * @property {number} INVALID_PAYER_ACCOUNT_ID=71 the response code when a smart contract id is passed for a crypto API request + * @property {number} ACCOUNT_DELETED=72 the account has been marked as deleted + * @property {number} FILE_DELETED=73 the file has been marked as deleted + * @property {number} ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS=74 same accounts repeated in the transfer account list + * @property {number} SETTING_NEGATIVE_ACCOUNT_BALANCE=75 attempting to set negative balance value for crypto account + * @property {number} OBTAINER_REQUIRED=76 when deleting smart contract that has crypto balance either transfer account or transfer smart + * contract is required + * @property {number} 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 + * @property {number} OBTAINER_DOES_NOT_EXIST=78 transferAccountId or transferContractId specified for contract delete does not exist + * @property {number} MODIFYING_IMMUTABLE_CONTRACT=79 attempting to modify (update or delete a immutable smart contract, i.e. one created without a + * admin key) + * @property {number} FILE_SYSTEM_EXCEPTION=80 Unexpected exception thrown by file system functions + * @property {number} AUTORENEW_DURATION_NOT_IN_RANGE=81 the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] + * @property {number} ERROR_DECODING_BYTESTRING=82 Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex + * string. + * @property {number} CONTRACT_FILE_EMPTY=83 File to create a smart contract was of length zero + * @property {number} CONTRACT_BYTECODE_EMPTY=84 Bytecode for smart contract is of length zero + * @property {number} INVALID_INITIAL_BALANCE=85 Attempt to set negative initial balance + * @property {number} INVALID_RECEIVE_RECORD_THRESHOLD=86 Attempt to set negative receive record threshold + * @property {number} INVALID_SEND_RECORD_THRESHOLD=87 Attempt to set negative send record threshold + * @property {number} 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 + * @property {number} PAYER_ACCOUNT_UNAUTHORIZED=89 The fee payer account doesn't have permission to submit such Transaction + * @property {number} INVALID_FREEZE_TRANSACTION_BODY=90 FreezeTransactionBody is invalid + * @property {number} FREEZE_TRANSACTION_BODY_NOT_FOUND=91 FreezeTransactionBody does not exist + * @property {number} TRANSFER_LIST_SIZE_LIMIT_EXCEEDED=92 Exceeded the number of accounts (both from and to) allowed for crypto transfer list + * @property {number} RESULT_SIZE_LIMIT_EXCEEDED=93 Smart contract result size greater than specified maxResultSize + * @property {number} NOT_SPECIAL_ACCOUNT=94 The payer account is not a special account(account 0.0.55) + * @property {number} CONTRACT_NEGATIVE_GAS=95 Negative gas was offered in smart contract call + * @property {number} CONTRACT_NEGATIVE_VALUE=96 Negative value / initial balance was specified in a smart contract call / create + * @property {number} INVALID_FEE_FILE=97 Failed to update fee file + * @property {number} INVALID_EXCHANGE_RATE_FILE=98 Failed to update exchange rate file + * @property {number} INSUFFICIENT_LOCAL_CALL_GAS=99 Payment tendered for contract local call cannot cover both the fee and the gas + * @property {number} ENTITY_NOT_ALLOWED_TO_DELETE=100 Entities with Entity ID below 1000 are not allowed to be deleted + * @property {number} 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). + * @property {number} FILE_UPLOADED_PROTO_INVALID=102 Fee Schedule Proto uploaded but not valid (append or update is required) + * @property {number} FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK=103 Fee Schedule Proto uploaded but not valid (append or update is required) + * @property {number} FEE_SCHEDULE_FILE_PART_UPLOADED=104 Fee Schedule Proto File Part uploaded + * @property {number} EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED=105 The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage + * @property {number} MAX_CONTRACT_STORAGE_EXCEEDED=106 Contract permanent storage exceeded the currently allowable limit + * @property {number} TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT=107 Transfer Account should not be same as Account to be deleted + * @property {number} TOTAL_LEDGER_BALANCE_INVALID=108 TOTAL_LEDGER_BALANCE_INVALID value + * @property {number} EXPIRATION_REDUCTION_NOT_ALLOWED=110 The expiration date/time on a smart contract may not be reduced + * @property {number} MAX_GAS_LIMIT_EXCEEDED=111 Gas exceeded currently allowable gas limit per transaction + * @property {number} MAX_FILE_SIZE_EXCEEDED=112 File size exceeded the currently allowable limit + * @property {number} RECEIVER_SIG_REQUIRED=113 When a valid signature is not provided for operations on account with receiverSigRequired=true + * @property {number} INVALID_TOPIC_ID=150 The Topic ID specified is not in the system. + * @property {number} INVALID_ADMIN_KEY=155 A provided admin key was invalid. Verify the bytes for an Ed25519 public key are exactly 32 bytes; and the bytes for a compressed ECDSA(secp256k1) key are exactly 33 bytes, with the first byte either 0x02 or 0x03.. + * @property {number} INVALID_SUBMIT_KEY=156 A provided submit key was invalid. + * @property {number} UNAUTHORIZED=157 An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). + * @property {number} INVALID_TOPIC_MESSAGE=158 A ConsensusService message is empty. + * @property {number} INVALID_AUTORENEW_ACCOUNT=159 The autoRenewAccount specified is not a valid, active account. + * @property {number} AUTORENEW_ACCOUNT_NOT_ALLOWED=160 An adminKey was not specified on the topic, so there must not be an autoRenewAccount. + * @property {number} TOPIC_EXPIRED=162 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. + * @property {number} INVALID_CHUNK_NUMBER=163 INVALID_CHUNK_NUMBER value + * @property {number} INVALID_CHUNK_TRANSACTION_ID=164 INVALID_CHUNK_TRANSACTION_ID value + * @property {number} ACCOUNT_FROZEN_FOR_TOKEN=165 ACCOUNT_FROZEN_FOR_TOKEN value + * @property {number} TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED=166 TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED value + * @property {number} INVALID_TOKEN_ID=167 INVALID_TOKEN_ID value + * @property {number} INVALID_TOKEN_DECIMALS=168 INVALID_TOKEN_DECIMALS value + * @property {number} INVALID_TOKEN_INITIAL_SUPPLY=169 INVALID_TOKEN_INITIAL_SUPPLY value + * @property {number} INVALID_TREASURY_ACCOUNT_FOR_TOKEN=170 INVALID_TREASURY_ACCOUNT_FOR_TOKEN value + * @property {number} INVALID_TOKEN_SYMBOL=171 INVALID_TOKEN_SYMBOL value + * @property {number} TOKEN_HAS_NO_FREEZE_KEY=172 TOKEN_HAS_NO_FREEZE_KEY value + * @property {number} TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN=173 TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN value + * @property {number} MISSING_TOKEN_SYMBOL=174 MISSING_TOKEN_SYMBOL value + * @property {number} TOKEN_SYMBOL_TOO_LONG=175 TOKEN_SYMBOL_TOO_LONG value + * @property {number} ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN=176 ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN value + * @property {number} TOKEN_HAS_NO_KYC_KEY=177 TOKEN_HAS_NO_KYC_KEY value + * @property {number} INSUFFICIENT_TOKEN_BALANCE=178 INSUFFICIENT_TOKEN_BALANCE value + * @property {number} TOKEN_WAS_DELETED=179 TOKEN_WAS_DELETED value + * @property {number} TOKEN_HAS_NO_SUPPLY_KEY=180 TOKEN_HAS_NO_SUPPLY_KEY value + * @property {number} TOKEN_HAS_NO_WIPE_KEY=181 TOKEN_HAS_NO_WIPE_KEY value + * @property {number} INVALID_TOKEN_MINT_AMOUNT=182 INVALID_TOKEN_MINT_AMOUNT value + * @property {number} INVALID_TOKEN_BURN_AMOUNT=183 INVALID_TOKEN_BURN_AMOUNT value + * @property {number} TOKEN_NOT_ASSOCIATED_TO_ACCOUNT=184 TOKEN_NOT_ASSOCIATED_TO_ACCOUNT value + * @property {number} CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT=185 CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT value + * @property {number} INVALID_KYC_KEY=186 INVALID_KYC_KEY value + * @property {number} INVALID_WIPE_KEY=187 INVALID_WIPE_KEY value + * @property {number} INVALID_FREEZE_KEY=188 INVALID_FREEZE_KEY value + * @property {number} INVALID_SUPPLY_KEY=189 INVALID_SUPPLY_KEY value + * @property {number} MISSING_TOKEN_NAME=190 MISSING_TOKEN_NAME value + * @property {number} TOKEN_NAME_TOO_LONG=191 TOKEN_NAME_TOO_LONG value + * @property {number} INVALID_WIPING_AMOUNT=192 INVALID_WIPING_AMOUNT value + * @property {number} TOKEN_IS_IMMUTABLE=193 TOKEN_IS_IMMUTABLE value + * @property {number} TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT=194 TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT value + * @property {number} TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES=195 TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES value + * @property {number} ACCOUNT_IS_TREASURY=196 ACCOUNT_IS_TREASURY value + * @property {number} TOKEN_ID_REPEATED_IN_TOKEN_LIST=197 TOKEN_ID_REPEATED_IN_TOKEN_LIST value + * @property {number} TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED=198 TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED value + * @property {number} EMPTY_TOKEN_TRANSFER_BODY=199 EMPTY_TOKEN_TRANSFER_BODY value + * @property {number} EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS=200 EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS value + * @property {number} INVALID_SCHEDULE_ID=201 The Scheduled entity does not exist; or has now expired, been deleted, or been executed + * @property {number} SCHEDULE_IS_IMMUTABLE=202 The Scheduled entity cannot be modified. Admin key not set + * @property {number} INVALID_SCHEDULE_PAYER_ID=203 The provided Scheduled Payer does not exist + * @property {number} INVALID_SCHEDULE_ACCOUNT_ID=204 The Schedule Create Transaction TransactionID account does not exist + * @property {number} NO_NEW_VALID_SIGNATURES=205 The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction + * @property {number} 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 + * @property {number} SCHEDULED_TRANSACTION_NOT_IN_WHITELIST=207 Only whitelisted transaction types may be scheduled + * @property {number} 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 + * @property {number} TRANSACTION_ID_FIELD_NOT_ALLOWED=209 The scheduled field in the TransactionID may not be set to true + * @property {number} 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) + * @property {number} INVALID_ZERO_BYTE_IN_STRING=211 A string field in the transaction has a UTF-8 encoding with the prohibited zero byte + * @property {number} SCHEDULE_ALREADY_DELETED=212 A schedule being signed or deleted has already been deleted + * @property {number} SCHEDULE_ALREADY_EXECUTED=213 A schedule being signed or deleted has already been executed + * @property {number} MESSAGE_SIZE_TOO_LARGE=214 ConsensusSubmitMessage request's message size is larger than allowed. + * @property {number} OPERATION_REPEATED_IN_BUCKET_GROUPS=215 An operation was assigned to more than one throttle group in a given bucket + * @property {number} BUCKET_CAPACITY_OVERFLOW=216 The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type + * @property {number} 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 + * @property {number} BUCKET_HAS_NO_THROTTLE_GROUPS=218 A bucket was defined without any throttle groups + * @property {number} THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC=219 A throttle group was granted zero opsPerSec + * @property {number} SUCCESS_BUT_MISSING_EXPECTED_OPERATION=220 The throttle definitions file was updated, but some supported operations were not assigned a bucket + * @property {number} UNPARSEABLE_THROTTLE_DEFINITIONS=221 The new contents for the throttle definitions system file were not valid protobuf + * @property {number} INVALID_THROTTLE_DEFINITIONS=222 The new throttle definitions system file were invalid, and no more specific error could be divined + * @property {number} 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 + * @property {number} INVALID_TOKEN_MAX_SUPPLY=224 Invalid token max supply + * @property {number} INVALID_TOKEN_NFT_SERIAL_NUMBER=225 Invalid token nft serial number + * @property {number} INVALID_NFT_ID=226 Invalid nft id + * @property {number} METADATA_TOO_LONG=227 Nft metadata is too long + * @property {number} BATCH_SIZE_LIMIT_EXCEEDED=228 Repeated operations count exceeds the limit + * @property {number} INVALID_QUERY_RANGE=229 The range of data to be gathered is out of the set boundaries + * @property {number} FRACTION_DIVIDES_BY_ZERO=230 A custom fractional fee set a denominator of zero + * @property {number} INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE=231 The transaction payer could not afford a custom fee + * @property {number} CUSTOM_FEES_LIST_TOO_LONG=232 More than 10 custom fees were specified + * @property {number} INVALID_CUSTOM_FEE_COLLECTOR=233 Any of the feeCollector accounts for customFees is invalid + * @property {number} INVALID_TOKEN_ID_IN_CUSTOM_FEES=234 Any of the token Ids in customFees is invalid + * @property {number} TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR=235 Any of the token Ids in customFees are not associated to feeCollector + * @property {number} TOKEN_MAX_SUPPLY_REACHED=236 A token cannot have more units minted due to its configured supply ceiling + * @property {number} SENDER_DOES_NOT_OWN_NFT_SERIAL_NO=237 The transaction attempted to move an NFT serial number from an account other than its owner + * @property {number} CUSTOM_FEE_NOT_FULLY_SPECIFIED=238 A custom fee schedule entry did not specify either a fixed or fractional fee + * @property {number} CUSTOM_FEE_MUST_BE_POSITIVE=239 Only positive fees may be assessed at this time + * @property {number} TOKEN_HAS_NO_FEE_SCHEDULE_KEY=240 Fee schedule key is not set on token + * @property {number} CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE=241 A fractional custom fee exceeded the range of a 64-bit signed integer + * @property {number} ROYALTY_FRACTION_CANNOT_EXCEED_ONE=242 A royalty cannot exceed the total fungible value exchanged for an NFT + * @property {number} FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT=243 Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount + * @property {number} CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES=244 A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty + * @property {number} CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON=245 Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations + * @property {number} CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON=246 Only tokens of type FUNGIBLE_COMMON can have fractional fees + * @property {number} INVALID_CUSTOM_FEE_SCHEDULE_KEY=247 The provided custom fee schedule key was invalid + * @property {number} INVALID_TOKEN_MINT_METADATA=248 The requested token mint metadata was invalid + * @property {number} INVALID_TOKEN_BURN_METADATA=249 The requested token burn metadata was invalid + * @property {number} CURRENT_TREASURY_STILL_OWNS_NFTS=250 The treasury for a unique token cannot be changed until it owns no NFTs + * @property {number} ACCOUNT_STILL_OWNS_NFTS=251 An account cannot be dissociated from a unique token if it owns NFTs for the token + * @property {number} TREASURY_MUST_OWN_BURNED_NFT=252 A NFT can only be burned when owned by the unique token's treasury + * @property {number} ACCOUNT_DOES_NOT_OWN_WIPED_NFT=253 An account did not own the NFT to be wiped + * @property {number} ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON=254 An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON + * @property {number} MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED=255 All the NFTs allowed in the current price regime have already been minted + * @property {number} PAYER_ACCOUNT_DELETED=256 The payer account has been marked as deleted + * @property {number} CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH=257 The reference chain of custom fees for a transferred token exceeded the maximum length of 2 + * @property {number} CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS=258 More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments + * @property {number} INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE=259 The sender account in the token transfer transaction could not afford a custom fee + * @property {number} SERIAL_NUMBER_LIMIT_REACHED=260 Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type + * @property {number} CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE=261 Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees + * @property {number} NO_REMAINING_AUTOMATIC_ASSOCIATIONS=262 The account has reached the limit on the automatic associations count. + * @property {number} EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT=263 Already existing automatic associations are more than the new maximum automatic associations. + * @property {number} REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT=264 Cannot set the number of automatic associations for an account more than the maximum allowed + * token associations tokens.maxPerAccount. + * @property {number} TOKEN_IS_PAUSED=265 Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + * @property {number} TOKEN_HAS_NO_PAUSE_KEY=266 Pause key is not set on token + * @property {number} INVALID_PAUSE_KEY=267 The provided pause key was invalid + * @property {number} FREEZE_UPDATE_FILE_DOES_NOT_EXIST=268 The update file in a freeze transaction body must exist. + * @property {number} FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH=269 The hash of the update file in a freeze transaction body must match the in-memory hash. + * @property {number} NO_UPGRADE_HAS_BEEN_PREPARED=270 A FREEZE_UPGRADE transaction was handled with no previous update prepared. + * @property {number} NO_FREEZE_IS_SCHEDULED=271 A FREEZE_ABORT transaction was handled with no scheduled freeze. + * @property {number} UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE=272 The update file hash when handling a FREEZE_UPGRADE transaction differs from the file + * hash at the time of handling the PREPARE_UPGRADE transaction. + * @property {number} FREEZE_START_TIME_MUST_BE_FUTURE=273 The given freeze start time was in the (consensus) past. + * @property {number} PREPARED_UPDATE_FILE_IS_IMMUTABLE=274 The prepared update file cannot be updated or appended until either the upgrade has + * been completed, or a FREEZE_ABORT has been handled. + * @property {number} FREEZE_ALREADY_SCHEDULED=275 Once a freeze is scheduled, it must be aborted before any other type of freeze can + * can be performed. + * @property {number} FREEZE_UPGRADE_IN_PROGRESS=276 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.) + * @property {number} UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED=277 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. + * @property {number} UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED=278 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. + * @property {number} CONSENSUS_GAS_EXHAUSTED=279 Consensus throttle did not allow execution of this transaction. System is throttled at + * consensus level. + * @property {number} REVERTED_SUCCESS=280 A precompiled contract succeeded, but was later reverted. + * @property {number} MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED=281 All contract storage allocated to the current price regime has been consumed. + * @property {number} INVALID_ALIAS_KEY=282 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. + * @property {number} UNEXPECTED_TOKEN_DECIMALS=283 A fungible token transfer expected a different number of decimals than the involved + * type actually has. + * @property {number} INVALID_PROXY_ACCOUNT_ID=284 The proxy account id is invalid or does not exist. + * @property {number} INVALID_TRANSFER_ACCOUNT_ID=285 The transfer account id in CryptoDelete transaction is invalid or does not exist. + * @property {number} INVALID_FEE_COLLECTOR_ACCOUNT_ID=286 The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. + * @property {number} ALIAS_IS_IMMUTABLE=287 The alias already set on an account cannot be updated using CryptoUpdate transaction. + * @property {number} SPENDER_ACCOUNT_SAME_AS_OWNER=288 An approved allowance specifies a spender account that is the same as the hbar/token + * owner account. + * @property {number} AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY=289 The establishment or adjustment of an approved allowance cause the token allowance + * to exceed the token maximum supply. + * @property {number} NEGATIVE_ALLOWANCE_AMOUNT=290 The specified amount for an approved allowance cannot be negative. + * @property {number} CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON=291 The approveForAll flag cannot be set for a fungible token. + * @property {number} SPENDER_DOES_NOT_HAVE_ALLOWANCE=292 The spender does not have an existing approved allowance with the hbar/token owner. + * @property {number} AMOUNT_EXCEEDS_ALLOWANCE=293 The transfer amount exceeds the current approved allowance for the spender account. + * @property {number} MAX_ALLOWANCES_EXCEEDED=294 The payer account of an approveAllowances or adjustAllowance transaction is attempting + * to go beyond the maximum allowed number of allowances. + * @property {number} EMPTY_ALLOWANCES=295 No allowances have been specified in the approval transaction. + * @property {number} SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES=296 Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single + * CryptoApproveAllowance transaction. + * @property {number} REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES=297 Serial numbers are repeated in nft allowance for a single spender account + * @property {number} FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES=298 Fungible common token used in NFT allowances + * @property {number} NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES=299 Non fungible token used in fungible token allowances + * @property {number} INVALID_ALLOWANCE_OWNER_ID=300 The account id specified as the owner is invalid or does not exist. + * @property {number} INVALID_ALLOWANCE_SPENDER_ID=301 The account id specified as the spender is invalid or does not exist. + * @property {number} REPEATED_ALLOWANCES_TO_DELETE=302 [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. + * @property {number} INVALID_DELEGATING_SPENDER=303 If the account Id specified as the delegating spender is invalid or does not exist. + * @property {number} DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL=304 The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. + * @property {number} DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL=305 The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll + * granted on token-owner. + * @property {number} SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE=306 The scheduled transaction could not be created because it's expiration_time was too far in the future. + * @property {number} SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME=307 The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. + * @property {number} SCHEDULE_FUTURE_THROTTLE_EXCEEDED=308 The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. + * @property {number} SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED=309 The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. + * @property {number} INVALID_ETHEREUM_TRANSACTION=310 The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. + * @property {number} WRONG_CHAIN_ID=311 EthereumTransaction was signed against a chainId that this network does not support. + * @property {number} WRONG_NONCE=312 This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. + * @property {number} ACCESS_LIST_UNSUPPORTED=313 The ethereum transaction specified an access list, which the network does not support. + * @property {number} SCHEDULE_PENDING_EXPIRATION=314 A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. + * @property {number} CONTRACT_IS_TOKEN_TREASURY=315 A selfdestruct or ContractDelete targeted a contract that is a token treasury. + * @property {number} CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES=316 A selfdestruct or ContractDelete targeted a contract with non-zero token balances. + * @property {number} CONTRACT_EXPIRED_AND_PENDING_REMOVAL=317 A contract referenced by a transaction is "detached"; that is, expired and lacking any + * hbar funds for auto-renewal payment---but still within its post-expiry grace period. + * @property {number} CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT=318 A ContractUpdate requested removal of a contract's auto-renew account, but that contract has + * no auto-renew account. + * @property {number} PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION=319 A delete transaction submitted via HAPI set permanent_removal=true + * @property {number} PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED=320 PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED value + * @property {number} SELF_STAKING_IS_NOT_ALLOWED=321 An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. + * @property {number} INVALID_STAKING_ID=322 The staking account id or staking node id given is invalid or does not exist. + * @property {number} STAKING_NOT_ENABLED=323 Native staking, while implemented, has not yet enabled by the council. + * @property {number} INVALID_PRNG_RANGE=324 The range provided in UtilPrng transaction is negative. + * @property {number} MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED=325 The maximum number of entities allowed in the current price regime have been created. + * @property {number} INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE=326 The full prefix signature for precompile is not valid + * @property {number} INSUFFICIENT_BALANCES_FOR_STORAGE_RENT=327 The combined balances of a contract and its auto-renew account (if any) did not cover + * the rent charged for net new storage used in a transaction. + * @property {number} MAX_CHILD_RECORDS_EXCEEDED=328 A contract transaction tried to use more than the allowed number of child records, via + * either system contract records or internal contract creations. + * @property {number} INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES=329 The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover + * the auto-renewal fees in a transaction. + * @property {number} TRANSACTION_HAS_UNKNOWN_FIELDS=330 A transaction's protobuf message includes unknown fields; could mean that a client + * expects not-yet-released functionality to be available. + * @property {number} ACCOUNT_IS_IMMUTABLE=331 The account cannot be modified. Account's key is not set + * @property {number} ALIAS_ALREADY_ASSIGNED=332 An alias that is assigned to an account or contract cannot be assigned to another account or contract. + * @property {number} INVALID_METADATA_KEY=333 A provided metadata key was invalid. Verification includes, for example, checking the size of Ed25519 and ECDSA(secp256k1) public keys. + * @property {number} TOKEN_HAS_NO_METADATA_KEY=334 Metadata key is not set on token + * @property {number} MISSING_TOKEN_METADATA=335 Token Metadata is not provided + * @property {number} MISSING_SERIAL_NUMBERS=336 NFT serial numbers are missing in the TokenUpdateNftsTransactionBody + * @property {number} TOKEN_HAS_NO_ADMIN_KEY=337 Admin key is not set on token + * @property {number} NODE_DELETED=338 A transaction failed because the consensus node identified is + * deleted from the address book. + * @property {number} INVALID_NODE_ID=339 A transaction failed because the consensus node identified is not valid or + * does not exist in state. + * @property {number} INVALID_GOSSIP_ENDPOINT=340 A transaction failed because one or more entries in the list of + * service endpoints for the `gossip_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + * @property {number} INVALID_NODE_ACCOUNT_ID=341 A transaction failed because the node account identifier provided + * does not exist or is not valid.
+ * One common source of this error is providing a node account identifier + * using the "alias" form rather than "numeric" form. + * It is also used for atomic batch transaction for child transaction if the node account id is not 0.0.0. + * @property {number} INVALID_NODE_DESCRIPTION=342 A transaction failed because the description field cannot be encoded + * as UTF-8 or is more than 100 bytes when encoded. + * @property {number} INVALID_SERVICE_ENDPOINT=343 A transaction failed because one or more entries in the list of + * service endpoints for the `service_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + * @property {number} INVALID_GOSSIP_CA_CERTIFICATE=344 A transaction failed because the TLS certificate provided for the + * node is missing or invalid. + *

+ * #### Probable Causes + * The certificate MUST be a TLS certificate of a type permitted for gossip + * signatures.
+ * The value presented MUST be a UTF-8 NFKD encoding of the TLS + * certificate.
+ * The certificate encoded MUST be in PEM format.
+ * The `gossip_ca_certificate` field is REQUIRED and MUST NOT be empty. + * @property {number} INVALID_GRPC_CERTIFICATE=345 A transaction failed because the hash provided for the gRPC certificate + * is present but invalid. + *

+ * #### Probable Causes + * The `grpc_certificate_hash` MUST be a SHA-384 hash.
+ * The input hashed MUST be a UTF-8 NFKD encoding of the actual TLS + * certificate.
+ * The certificate to be encoded MUST be in PEM format. + * @property {number} INVALID_MAX_AUTO_ASSOCIATIONS=346 The maximum automatic associations value is not valid.
+ * The most common cause for this error is a value less than `-1`. + * @property {number} MAX_NODES_CREATED=347 The maximum number of nodes allowed in the address book have been created. + * @property {number} IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT=348 In ServiceEndpoint, domain_name and ipAddressV4 are mutually exclusive + * @property {number} GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN=349 Fully qualified domain name is not allowed in gossip_endpoint + * @property {number} FQDN_SIZE_TOO_LARGE=350 In ServiceEndpoint, domain_name size too large + * @property {number} INVALID_ENDPOINT=351 ServiceEndpoint is invalid + * @property {number} GOSSIP_ENDPOINTS_EXCEEDED_LIMIT=352 The number of gossip endpoints exceeds the limit + * @property {number} TOKEN_REFERENCE_REPEATED=353 The transaction attempted to use duplicate `TokenReference`.
+ * This affects `TokenReject` attempting to reject same token reference more than once. + * @property {number} INVALID_OWNER_ID=354 The account id specified as the owner in `TokenReject` is invalid or does not exist. + * @property {number} TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED=355 The transaction attempted to use more than the allowed number of `TokenReference`. + * @property {number} SERVICE_ENDPOINTS_EXCEEDED_LIMIT=356 The number of service endpoints exceeds the limit + * @property {number} INVALID_IPV4_ADDRESS=357 INVALID_IPV4_ADDRESS value + * @property {number} EMPTY_TOKEN_REFERENCE_LIST=358 The transaction attempted to use empty `TokenReference` list. + * @property {number} UPDATE_NODE_ACCOUNT_NOT_ALLOWED=359 UPDATE_NODE_ACCOUNT_NOT_ALLOWED value + * @property {number} TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY=360 TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY value + * @property {number} EMPTY_PENDING_AIRDROP_ID_LIST=361 The list of `PendingAirdropId`s is empty and MUST NOT be empty. + * @property {number} PENDING_AIRDROP_ID_REPEATED=362 A `PendingAirdropId` is repeated in a `claim` or `cancel` transaction. + * @property {number} PENDING_AIRDROP_ID_LIST_TOO_LONG=363 The number of `PendingAirdropId` values in the list exceeds the maximum + * allowable number. + * @property {number} PENDING_NFT_AIRDROP_ALREADY_EXISTS=364 PENDING_NFT_AIRDROP_ALREADY_EXISTS value + * @property {number} ACCOUNT_HAS_PENDING_AIRDROPS=365 ACCOUNT_HAS_PENDING_AIRDROPS value + * @property {number} THROTTLED_AT_CONSENSUS=366 Consensus throttle did not allow execution of this transaction.
+ * The transaction should be retried after a modest delay. + * @property {number} INVALID_PENDING_AIRDROP_ID=367 The provided pending airdrop id is invalid.
+ * This pending airdrop MAY already be claimed or cancelled. + *

+ * The client SHOULD query a mirror node to determine the current status of + * the pending airdrop. + * @property {number} TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY=368 The token to be airdropped has a fallback royalty fee and cannot be + * sent or claimed via an airdrop transaction. + * @property {number} INVALID_TOKEN_IN_PENDING_AIRDROP=369 This airdrop claim is for a pending airdrop with an invalid token.
+ * The token might be deleted, or the sender may not have enough tokens + * to fulfill the offer. + *

+ * The client SHOULD query mirror node to determine the status of the + * pending airdrop and whether the sender can fulfill the offer. + * @property {number} SCHEDULE_EXPIRY_IS_BUSY=370 A scheduled transaction configured to wait for expiry to execute was given + * an expiry time at which there is already too many transactions scheduled to + * expire; its creation must be retried with a different expiry. + * @property {number} INVALID_GRPC_CERTIFICATE_HASH=371 The provided gRPC certificate hash is invalid. + * @property {number} MISSING_EXPIRY_TIME=372 A scheduled transaction configured to wait for expiry to execute was not + * given an explicit expiration time. + * @property {number} NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION=373 A contract operation attempted to schedule another transaction after it + * had already scheduled a recursive contract call. + * @property {number} RECURSIVE_SCHEDULING_LIMIT_REACHED=374 A contract can schedule recursive calls a finite number of times (this is + * approximately four million times with typical network configuration.) + * @property {number} WAITING_FOR_LEDGER_ID=375 The target network is waiting for the ledger ID to be set, which is a + * side effect of finishing the network's TSS construction. + * @property {number} MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED=376 The provided fee exempt key list size exceeded the limit. + * @property {number} FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS=377 The provided fee exempt key list contains duplicated keys. + * @property {number} INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST=378 The provided fee exempt key list contains an invalid key. + * @property {number} INVALID_FEE_SCHEDULE_KEY=379 The provided fee schedule key contains an invalid key. + * @property {number} FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED=380 If a fee schedule key is not set when we create a topic + * we cannot add it on update. + * @property {number} FEE_SCHEDULE_KEY_NOT_SET=381 If the topic's custom fees are updated the topic SHOULD have a + * fee schedule key + * @property {number} MAX_CUSTOM_FEE_LIMIT_EXCEEDED=382 The fee amount is exceeding the amount that the payer + * is willing to pay. + * @property {number} NO_VALID_MAX_CUSTOM_FEE=383 There are no corresponding custom fees. + * @property {number} INVALID_MAX_CUSTOM_FEES=384 The provided list contains invalid max custom fee. + * @property {number} DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST=385 The provided max custom fee list contains fees with + * duplicate denominations. + * @property {number} DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST=386 The provided max custom fee list contains fees with + * duplicate account id. + * @property {number} MAX_CUSTOM_FEES_IS_NOT_SUPPORTED=387 Max custom fees list is not supported for this operation. + * @property {number} BATCH_LIST_EMPTY=388 The list of batch transactions is empty + * @property {number} BATCH_LIST_CONTAINS_DUPLICATES=389 The list of batch transactions contains duplicated transactions + * @property {number} BATCH_TRANSACTION_IN_BLACKLIST=390 The list of batch transactions contains a transaction type that is + * in the AtomicBatch blacklist as configured in the network. + * @property {number} INNER_TRANSACTION_FAILED=391 The inner transaction of a batch transaction failed + * @property {number} MISSING_BATCH_KEY=392 The inner transaction of a batch transaction is missing a batch key + * @property {number} BATCH_KEY_SET_ON_NON_INNER_TRANSACTION=393 The batch key is set for a non batch transaction + * @property {number} INVALID_BATCH_KEY=394 The batch key is not valid + * @property {number} SCHEDULE_EXPIRY_NOT_CONFIGURABLE=395 The provided schedule expiry time is not configurable. + * @property {number} CREATING_SYSTEM_ENTITIES=396 The network just started at genesis and is creating system entities. + * @property {number} THROTTLE_GROUP_LCM_OVERFLOW=397 The least common multiple of the throttle group's milliOpsPerSec is + * too large and it's overflowing. + * @property {number} AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN=398 Token airdrop transactions can not contain multiple senders for a single token. + * @property {number} GRPC_WEB_PROXY_NOT_SUPPORTED=399 The GRPC proxy endpoint is set in the NodeCreate or NodeUpdate transaction, + * which the network does not support. + * @property {number} NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE=400 An NFT transfers list referenced a token type other than NON_FUNGIBLE_UNIQUE. + */ + proto.ResponseCodeEnum = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "INVALID_TRANSACTION"] = 1; + values[valuesById[2] = "PAYER_ACCOUNT_NOT_FOUND"] = 2; + values[valuesById[3] = "INVALID_NODE_ACCOUNT"] = 3; + values[valuesById[4] = "TRANSACTION_EXPIRED"] = 4; + values[valuesById[5] = "INVALID_TRANSACTION_START"] = 5; + values[valuesById[6] = "INVALID_TRANSACTION_DURATION"] = 6; + values[valuesById[7] = "INVALID_SIGNATURE"] = 7; + values[valuesById[8] = "MEMO_TOO_LONG"] = 8; + values[valuesById[9] = "INSUFFICIENT_TX_FEE"] = 9; + values[valuesById[10] = "INSUFFICIENT_PAYER_BALANCE"] = 10; + values[valuesById[11] = "DUPLICATE_TRANSACTION"] = 11; + values[valuesById[12] = "BUSY"] = 12; + values[valuesById[13] = "NOT_SUPPORTED"] = 13; + values[valuesById[14] = "INVALID_FILE_ID"] = 14; + values[valuesById[15] = "INVALID_ACCOUNT_ID"] = 15; + values[valuesById[16] = "INVALID_CONTRACT_ID"] = 16; + values[valuesById[17] = "INVALID_TRANSACTION_ID"] = 17; + values[valuesById[18] = "RECEIPT_NOT_FOUND"] = 18; + values[valuesById[19] = "RECORD_NOT_FOUND"] = 19; + values[valuesById[20] = "INVALID_SOLIDITY_ID"] = 20; + values[valuesById[21] = "UNKNOWN"] = 21; + values[valuesById[22] = "SUCCESS"] = 22; + values[valuesById[23] = "FAIL_INVALID"] = 23; + values[valuesById[24] = "FAIL_FEE"] = 24; + values[valuesById[25] = "FAIL_BALANCE"] = 25; + values[valuesById[26] = "KEY_REQUIRED"] = 26; + values[valuesById[27] = "BAD_ENCODING"] = 27; + values[valuesById[28] = "INSUFFICIENT_ACCOUNT_BALANCE"] = 28; + values[valuesById[29] = "INVALID_SOLIDITY_ADDRESS"] = 29; + values[valuesById[30] = "INSUFFICIENT_GAS"] = 30; + values[valuesById[31] = "CONTRACT_SIZE_LIMIT_EXCEEDED"] = 31; + values[valuesById[32] = "LOCAL_CALL_MODIFICATION_EXCEPTION"] = 32; + values[valuesById[33] = "CONTRACT_REVERT_EXECUTED"] = 33; + values[valuesById[34] = "CONTRACT_EXECUTION_EXCEPTION"] = 34; + values[valuesById[35] = "INVALID_RECEIVING_NODE_ACCOUNT"] = 35; + values[valuesById[36] = "MISSING_QUERY_HEADER"] = 36; + values[valuesById[37] = "ACCOUNT_UPDATE_FAILED"] = 37; + values[valuesById[38] = "INVALID_KEY_ENCODING"] = 38; + values[valuesById[39] = "NULL_SOLIDITY_ADDRESS"] = 39; + values[valuesById[40] = "CONTRACT_UPDATE_FAILED"] = 40; + values[valuesById[41] = "INVALID_QUERY_HEADER"] = 41; + values[valuesById[42] = "INVALID_FEE_SUBMITTED"] = 42; + values[valuesById[43] = "INVALID_PAYER_SIGNATURE"] = 43; + values[valuesById[44] = "KEY_NOT_PROVIDED"] = 44; + values[valuesById[45] = "INVALID_EXPIRATION_TIME"] = 45; + values[valuesById[46] = "NO_WACL_KEY"] = 46; + values[valuesById[47] = "FILE_CONTENT_EMPTY"] = 47; + values[valuesById[48] = "INVALID_ACCOUNT_AMOUNTS"] = 48; + values[valuesById[49] = "EMPTY_TRANSACTION_BODY"] = 49; + values[valuesById[50] = "INVALID_TRANSACTION_BODY"] = 50; + values[valuesById[51] = "INVALID_SIGNATURE_TYPE_MISMATCHING_KEY"] = 51; + values[valuesById[52] = "INVALID_SIGNATURE_COUNT_MISMATCHING_KEY"] = 52; + values[valuesById[53] = "EMPTY_LIVE_HASH_BODY"] = 53; + values[valuesById[54] = "EMPTY_LIVE_HASH"] = 54; + values[valuesById[55] = "EMPTY_LIVE_HASH_KEYS"] = 55; + values[valuesById[56] = "INVALID_LIVE_HASH_SIZE"] = 56; + values[valuesById[57] = "EMPTY_QUERY_BODY"] = 57; + values[valuesById[58] = "EMPTY_LIVE_HASH_QUERY"] = 58; + values[valuesById[59] = "LIVE_HASH_NOT_FOUND"] = 59; + values[valuesById[60] = "ACCOUNT_ID_DOES_NOT_EXIST"] = 60; + values[valuesById[61] = "LIVE_HASH_ALREADY_EXISTS"] = 61; + values[valuesById[62] = "INVALID_FILE_WACL"] = 62; + values[valuesById[63] = "SERIALIZATION_FAILED"] = 63; + values[valuesById[64] = "TRANSACTION_OVERSIZE"] = 64; + values[valuesById[65] = "TRANSACTION_TOO_MANY_LAYERS"] = 65; + values[valuesById[66] = "CONTRACT_DELETED"] = 66; + values[valuesById[67] = "PLATFORM_NOT_ACTIVE"] = 67; + values[valuesById[68] = "KEY_PREFIX_MISMATCH"] = 68; + values[valuesById[69] = "PLATFORM_TRANSACTION_NOT_CREATED"] = 69; + values[valuesById[70] = "INVALID_RENEWAL_PERIOD"] = 70; + values[valuesById[71] = "INVALID_PAYER_ACCOUNT_ID"] = 71; + values[valuesById[72] = "ACCOUNT_DELETED"] = 72; + values[valuesById[73] = "FILE_DELETED"] = 73; + values[valuesById[74] = "ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS"] = 74; + values[valuesById[75] = "SETTING_NEGATIVE_ACCOUNT_BALANCE"] = 75; + values[valuesById[76] = "OBTAINER_REQUIRED"] = 76; + values[valuesById[77] = "OBTAINER_SAME_CONTRACT_ID"] = 77; + values[valuesById[78] = "OBTAINER_DOES_NOT_EXIST"] = 78; + values[valuesById[79] = "MODIFYING_IMMUTABLE_CONTRACT"] = 79; + values[valuesById[80] = "FILE_SYSTEM_EXCEPTION"] = 80; + values[valuesById[81] = "AUTORENEW_DURATION_NOT_IN_RANGE"] = 81; + values[valuesById[82] = "ERROR_DECODING_BYTESTRING"] = 82; + values[valuesById[83] = "CONTRACT_FILE_EMPTY"] = 83; + values[valuesById[84] = "CONTRACT_BYTECODE_EMPTY"] = 84; + values[valuesById[85] = "INVALID_INITIAL_BALANCE"] = 85; + values[valuesById[86] = "INVALID_RECEIVE_RECORD_THRESHOLD"] = 86; + values[valuesById[87] = "INVALID_SEND_RECORD_THRESHOLD"] = 87; + values[valuesById[88] = "ACCOUNT_IS_NOT_GENESIS_ACCOUNT"] = 88; + values[valuesById[89] = "PAYER_ACCOUNT_UNAUTHORIZED"] = 89; + values[valuesById[90] = "INVALID_FREEZE_TRANSACTION_BODY"] = 90; + values[valuesById[91] = "FREEZE_TRANSACTION_BODY_NOT_FOUND"] = 91; + values[valuesById[92] = "TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"] = 92; + values[valuesById[93] = "RESULT_SIZE_LIMIT_EXCEEDED"] = 93; + values[valuesById[94] = "NOT_SPECIAL_ACCOUNT"] = 94; + values[valuesById[95] = "CONTRACT_NEGATIVE_GAS"] = 95; + values[valuesById[96] = "CONTRACT_NEGATIVE_VALUE"] = 96; + values[valuesById[97] = "INVALID_FEE_FILE"] = 97; + values[valuesById[98] = "INVALID_EXCHANGE_RATE_FILE"] = 98; + values[valuesById[99] = "INSUFFICIENT_LOCAL_CALL_GAS"] = 99; + values[valuesById[100] = "ENTITY_NOT_ALLOWED_TO_DELETE"] = 100; + values[valuesById[101] = "AUTHORIZATION_FAILED"] = 101; + values[valuesById[102] = "FILE_UPLOADED_PROTO_INVALID"] = 102; + values[valuesById[103] = "FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK"] = 103; + values[valuesById[104] = "FEE_SCHEDULE_FILE_PART_UPLOADED"] = 104; + values[valuesById[105] = "EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED"] = 105; + values[valuesById[106] = "MAX_CONTRACT_STORAGE_EXCEEDED"] = 106; + values[valuesById[107] = "TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT"] = 107; + values[valuesById[108] = "TOTAL_LEDGER_BALANCE_INVALID"] = 108; + values[valuesById[110] = "EXPIRATION_REDUCTION_NOT_ALLOWED"] = 110; + values[valuesById[111] = "MAX_GAS_LIMIT_EXCEEDED"] = 111; + values[valuesById[112] = "MAX_FILE_SIZE_EXCEEDED"] = 112; + values[valuesById[113] = "RECEIVER_SIG_REQUIRED"] = 113; + values[valuesById[150] = "INVALID_TOPIC_ID"] = 150; + values[valuesById[155] = "INVALID_ADMIN_KEY"] = 155; + values[valuesById[156] = "INVALID_SUBMIT_KEY"] = 156; + values[valuesById[157] = "UNAUTHORIZED"] = 157; + values[valuesById[158] = "INVALID_TOPIC_MESSAGE"] = 158; + values[valuesById[159] = "INVALID_AUTORENEW_ACCOUNT"] = 159; + values[valuesById[160] = "AUTORENEW_ACCOUNT_NOT_ALLOWED"] = 160; + values[valuesById[162] = "TOPIC_EXPIRED"] = 162; + values[valuesById[163] = "INVALID_CHUNK_NUMBER"] = 163; + values[valuesById[164] = "INVALID_CHUNK_TRANSACTION_ID"] = 164; + values[valuesById[165] = "ACCOUNT_FROZEN_FOR_TOKEN"] = 165; + values[valuesById[166] = "TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED"] = 166; + values[valuesById[167] = "INVALID_TOKEN_ID"] = 167; + values[valuesById[168] = "INVALID_TOKEN_DECIMALS"] = 168; + values[valuesById[169] = "INVALID_TOKEN_INITIAL_SUPPLY"] = 169; + values[valuesById[170] = "INVALID_TREASURY_ACCOUNT_FOR_TOKEN"] = 170; + values[valuesById[171] = "INVALID_TOKEN_SYMBOL"] = 171; + values[valuesById[172] = "TOKEN_HAS_NO_FREEZE_KEY"] = 172; + values[valuesById[173] = "TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN"] = 173; + values[valuesById[174] = "MISSING_TOKEN_SYMBOL"] = 174; + values[valuesById[175] = "TOKEN_SYMBOL_TOO_LONG"] = 175; + values[valuesById[176] = "ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN"] = 176; + values[valuesById[177] = "TOKEN_HAS_NO_KYC_KEY"] = 177; + values[valuesById[178] = "INSUFFICIENT_TOKEN_BALANCE"] = 178; + values[valuesById[179] = "TOKEN_WAS_DELETED"] = 179; + values[valuesById[180] = "TOKEN_HAS_NO_SUPPLY_KEY"] = 180; + values[valuesById[181] = "TOKEN_HAS_NO_WIPE_KEY"] = 181; + values[valuesById[182] = "INVALID_TOKEN_MINT_AMOUNT"] = 182; + values[valuesById[183] = "INVALID_TOKEN_BURN_AMOUNT"] = 183; + values[valuesById[184] = "TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"] = 184; + values[valuesById[185] = "CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT"] = 185; + values[valuesById[186] = "INVALID_KYC_KEY"] = 186; + values[valuesById[187] = "INVALID_WIPE_KEY"] = 187; + values[valuesById[188] = "INVALID_FREEZE_KEY"] = 188; + values[valuesById[189] = "INVALID_SUPPLY_KEY"] = 189; + values[valuesById[190] = "MISSING_TOKEN_NAME"] = 190; + values[valuesById[191] = "TOKEN_NAME_TOO_LONG"] = 191; + values[valuesById[192] = "INVALID_WIPING_AMOUNT"] = 192; + values[valuesById[193] = "TOKEN_IS_IMMUTABLE"] = 193; + values[valuesById[194] = "TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT"] = 194; + values[valuesById[195] = "TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES"] = 195; + values[valuesById[196] = "ACCOUNT_IS_TREASURY"] = 196; + values[valuesById[197] = "TOKEN_ID_REPEATED_IN_TOKEN_LIST"] = 197; + values[valuesById[198] = "TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"] = 198; + values[valuesById[199] = "EMPTY_TOKEN_TRANSFER_BODY"] = 199; + values[valuesById[200] = "EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS"] = 200; + values[valuesById[201] = "INVALID_SCHEDULE_ID"] = 201; + values[valuesById[202] = "SCHEDULE_IS_IMMUTABLE"] = 202; + values[valuesById[203] = "INVALID_SCHEDULE_PAYER_ID"] = 203; + values[valuesById[204] = "INVALID_SCHEDULE_ACCOUNT_ID"] = 204; + values[valuesById[205] = "NO_NEW_VALID_SIGNATURES"] = 205; + values[valuesById[206] = "UNRESOLVABLE_REQUIRED_SIGNERS"] = 206; + values[valuesById[207] = "SCHEDULED_TRANSACTION_NOT_IN_WHITELIST"] = 207; + values[valuesById[208] = "SOME_SIGNATURES_WERE_INVALID"] = 208; + values[valuesById[209] = "TRANSACTION_ID_FIELD_NOT_ALLOWED"] = 209; + values[valuesById[210] = "IDENTICAL_SCHEDULE_ALREADY_CREATED"] = 210; + values[valuesById[211] = "INVALID_ZERO_BYTE_IN_STRING"] = 211; + values[valuesById[212] = "SCHEDULE_ALREADY_DELETED"] = 212; + values[valuesById[213] = "SCHEDULE_ALREADY_EXECUTED"] = 213; + values[valuesById[214] = "MESSAGE_SIZE_TOO_LARGE"] = 214; + values[valuesById[215] = "OPERATION_REPEATED_IN_BUCKET_GROUPS"] = 215; + values[valuesById[216] = "BUCKET_CAPACITY_OVERFLOW"] = 216; + values[valuesById[217] = "NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION"] = 217; + values[valuesById[218] = "BUCKET_HAS_NO_THROTTLE_GROUPS"] = 218; + values[valuesById[219] = "THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC"] = 219; + values[valuesById[220] = "SUCCESS_BUT_MISSING_EXPECTED_OPERATION"] = 220; + values[valuesById[221] = "UNPARSEABLE_THROTTLE_DEFINITIONS"] = 221; + values[valuesById[222] = "INVALID_THROTTLE_DEFINITIONS"] = 222; + values[valuesById[223] = "ACCOUNT_EXPIRED_AND_PENDING_REMOVAL"] = 223; + values[valuesById[224] = "INVALID_TOKEN_MAX_SUPPLY"] = 224; + values[valuesById[225] = "INVALID_TOKEN_NFT_SERIAL_NUMBER"] = 225; + values[valuesById[226] = "INVALID_NFT_ID"] = 226; + values[valuesById[227] = "METADATA_TOO_LONG"] = 227; + values[valuesById[228] = "BATCH_SIZE_LIMIT_EXCEEDED"] = 228; + values[valuesById[229] = "INVALID_QUERY_RANGE"] = 229; + values[valuesById[230] = "FRACTION_DIVIDES_BY_ZERO"] = 230; + values[valuesById[231] = "INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE"] = 231; + values[valuesById[232] = "CUSTOM_FEES_LIST_TOO_LONG"] = 232; + values[valuesById[233] = "INVALID_CUSTOM_FEE_COLLECTOR"] = 233; + values[valuesById[234] = "INVALID_TOKEN_ID_IN_CUSTOM_FEES"] = 234; + values[valuesById[235] = "TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR"] = 235; + values[valuesById[236] = "TOKEN_MAX_SUPPLY_REACHED"] = 236; + values[valuesById[237] = "SENDER_DOES_NOT_OWN_NFT_SERIAL_NO"] = 237; + values[valuesById[238] = "CUSTOM_FEE_NOT_FULLY_SPECIFIED"] = 238; + values[valuesById[239] = "CUSTOM_FEE_MUST_BE_POSITIVE"] = 239; + values[valuesById[240] = "TOKEN_HAS_NO_FEE_SCHEDULE_KEY"] = 240; + values[valuesById[241] = "CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE"] = 241; + values[valuesById[242] = "ROYALTY_FRACTION_CANNOT_EXCEED_ONE"] = 242; + values[valuesById[243] = "FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT"] = 243; + values[valuesById[244] = "CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES"] = 244; + values[valuesById[245] = "CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON"] = 245; + values[valuesById[246] = "CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"] = 246; + values[valuesById[247] = "INVALID_CUSTOM_FEE_SCHEDULE_KEY"] = 247; + values[valuesById[248] = "INVALID_TOKEN_MINT_METADATA"] = 248; + values[valuesById[249] = "INVALID_TOKEN_BURN_METADATA"] = 249; + values[valuesById[250] = "CURRENT_TREASURY_STILL_OWNS_NFTS"] = 250; + values[valuesById[251] = "ACCOUNT_STILL_OWNS_NFTS"] = 251; + values[valuesById[252] = "TREASURY_MUST_OWN_BURNED_NFT"] = 252; + values[valuesById[253] = "ACCOUNT_DOES_NOT_OWN_WIPED_NFT"] = 253; + values[valuesById[254] = "ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"] = 254; + values[valuesById[255] = "MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED"] = 255; + values[valuesById[256] = "PAYER_ACCOUNT_DELETED"] = 256; + values[valuesById[257] = "CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH"] = 257; + values[valuesById[258] = "CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS"] = 258; + values[valuesById[259] = "INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE"] = 259; + values[valuesById[260] = "SERIAL_NUMBER_LIMIT_REACHED"] = 260; + values[valuesById[261] = "CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE"] = 261; + values[valuesById[262] = "NO_REMAINING_AUTOMATIC_ASSOCIATIONS"] = 262; + values[valuesById[263] = "EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT"] = 263; + values[valuesById[264] = "REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT"] = 264; + values[valuesById[265] = "TOKEN_IS_PAUSED"] = 265; + values[valuesById[266] = "TOKEN_HAS_NO_PAUSE_KEY"] = 266; + values[valuesById[267] = "INVALID_PAUSE_KEY"] = 267; + values[valuesById[268] = "FREEZE_UPDATE_FILE_DOES_NOT_EXIST"] = 268; + values[valuesById[269] = "FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH"] = 269; + values[valuesById[270] = "NO_UPGRADE_HAS_BEEN_PREPARED"] = 270; + values[valuesById[271] = "NO_FREEZE_IS_SCHEDULED"] = 271; + values[valuesById[272] = "UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE"] = 272; + values[valuesById[273] = "FREEZE_START_TIME_MUST_BE_FUTURE"] = 273; + values[valuesById[274] = "PREPARED_UPDATE_FILE_IS_IMMUTABLE"] = 274; + values[valuesById[275] = "FREEZE_ALREADY_SCHEDULED"] = 275; + values[valuesById[276] = "FREEZE_UPGRADE_IN_PROGRESS"] = 276; + values[valuesById[277] = "UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED"] = 277; + values[valuesById[278] = "UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED"] = 278; + values[valuesById[279] = "CONSENSUS_GAS_EXHAUSTED"] = 279; + values[valuesById[280] = "REVERTED_SUCCESS"] = 280; + values[valuesById[281] = "MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED"] = 281; + values[valuesById[282] = "INVALID_ALIAS_KEY"] = 282; + values[valuesById[283] = "UNEXPECTED_TOKEN_DECIMALS"] = 283; + values[valuesById[284] = "INVALID_PROXY_ACCOUNT_ID"] = 284; + values[valuesById[285] = "INVALID_TRANSFER_ACCOUNT_ID"] = 285; + values[valuesById[286] = "INVALID_FEE_COLLECTOR_ACCOUNT_ID"] = 286; + values[valuesById[287] = "ALIAS_IS_IMMUTABLE"] = 287; + values[valuesById[288] = "SPENDER_ACCOUNT_SAME_AS_OWNER"] = 288; + values[valuesById[289] = "AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY"] = 289; + values[valuesById[290] = "NEGATIVE_ALLOWANCE_AMOUNT"] = 290; + values[valuesById[291] = "CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON"] = 291; + values[valuesById[292] = "SPENDER_DOES_NOT_HAVE_ALLOWANCE"] = 292; + values[valuesById[293] = "AMOUNT_EXCEEDS_ALLOWANCE"] = 293; + values[valuesById[294] = "MAX_ALLOWANCES_EXCEEDED"] = 294; + values[valuesById[295] = "EMPTY_ALLOWANCES"] = 295; + values[valuesById[296] = "SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES"] = 296; + values[valuesById[297] = "REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES"] = 297; + values[valuesById[298] = "FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES"] = 298; + values[valuesById[299] = "NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES"] = 299; + values[valuesById[300] = "INVALID_ALLOWANCE_OWNER_ID"] = 300; + values[valuesById[301] = "INVALID_ALLOWANCE_SPENDER_ID"] = 301; + values[valuesById[302] = "REPEATED_ALLOWANCES_TO_DELETE"] = 302; + values[valuesById[303] = "INVALID_DELEGATING_SPENDER"] = 303; + values[valuesById[304] = "DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL"] = 304; + values[valuesById[305] = "DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL"] = 305; + values[valuesById[306] = "SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE"] = 306; + values[valuesById[307] = "SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME"] = 307; + values[valuesById[308] = "SCHEDULE_FUTURE_THROTTLE_EXCEEDED"] = 308; + values[valuesById[309] = "SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED"] = 309; + values[valuesById[310] = "INVALID_ETHEREUM_TRANSACTION"] = 310; + values[valuesById[311] = "WRONG_CHAIN_ID"] = 311; + values[valuesById[312] = "WRONG_NONCE"] = 312; + values[valuesById[313] = "ACCESS_LIST_UNSUPPORTED"] = 313; + values[valuesById[314] = "SCHEDULE_PENDING_EXPIRATION"] = 314; + values[valuesById[315] = "CONTRACT_IS_TOKEN_TREASURY"] = 315; + values[valuesById[316] = "CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES"] = 316; + values[valuesById[317] = "CONTRACT_EXPIRED_AND_PENDING_REMOVAL"] = 317; + values[valuesById[318] = "CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT"] = 318; + values[valuesById[319] = "PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION"] = 319; + values[valuesById[320] = "PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED"] = 320; + values[valuesById[321] = "SELF_STAKING_IS_NOT_ALLOWED"] = 321; + values[valuesById[322] = "INVALID_STAKING_ID"] = 322; + values[valuesById[323] = "STAKING_NOT_ENABLED"] = 323; + values[valuesById[324] = "INVALID_PRNG_RANGE"] = 324; + values[valuesById[325] = "MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED"] = 325; + values[valuesById[326] = "INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE"] = 326; + values[valuesById[327] = "INSUFFICIENT_BALANCES_FOR_STORAGE_RENT"] = 327; + values[valuesById[328] = "MAX_CHILD_RECORDS_EXCEEDED"] = 328; + values[valuesById[329] = "INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES"] = 329; + values[valuesById[330] = "TRANSACTION_HAS_UNKNOWN_FIELDS"] = 330; + values[valuesById[331] = "ACCOUNT_IS_IMMUTABLE"] = 331; + values[valuesById[332] = "ALIAS_ALREADY_ASSIGNED"] = 332; + values[valuesById[333] = "INVALID_METADATA_KEY"] = 333; + values[valuesById[334] = "TOKEN_HAS_NO_METADATA_KEY"] = 334; + values[valuesById[335] = "MISSING_TOKEN_METADATA"] = 335; + values[valuesById[336] = "MISSING_SERIAL_NUMBERS"] = 336; + values[valuesById[337] = "TOKEN_HAS_NO_ADMIN_KEY"] = 337; + values[valuesById[338] = "NODE_DELETED"] = 338; + values[valuesById[339] = "INVALID_NODE_ID"] = 339; + values[valuesById[340] = "INVALID_GOSSIP_ENDPOINT"] = 340; + values[valuesById[341] = "INVALID_NODE_ACCOUNT_ID"] = 341; + values[valuesById[342] = "INVALID_NODE_DESCRIPTION"] = 342; + values[valuesById[343] = "INVALID_SERVICE_ENDPOINT"] = 343; + values[valuesById[344] = "INVALID_GOSSIP_CA_CERTIFICATE"] = 344; + values[valuesById[345] = "INVALID_GRPC_CERTIFICATE"] = 345; + values[valuesById[346] = "INVALID_MAX_AUTO_ASSOCIATIONS"] = 346; + values[valuesById[347] = "MAX_NODES_CREATED"] = 347; + values[valuesById[348] = "IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT"] = 348; + values[valuesById[349] = "GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN"] = 349; + values[valuesById[350] = "FQDN_SIZE_TOO_LARGE"] = 350; + values[valuesById[351] = "INVALID_ENDPOINT"] = 351; + values[valuesById[352] = "GOSSIP_ENDPOINTS_EXCEEDED_LIMIT"] = 352; + values[valuesById[353] = "TOKEN_REFERENCE_REPEATED"] = 353; + values[valuesById[354] = "INVALID_OWNER_ID"] = 354; + values[valuesById[355] = "TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED"] = 355; + values[valuesById[356] = "SERVICE_ENDPOINTS_EXCEEDED_LIMIT"] = 356; + values[valuesById[357] = "INVALID_IPV4_ADDRESS"] = 357; + values[valuesById[358] = "EMPTY_TOKEN_REFERENCE_LIST"] = 358; + values[valuesById[359] = "UPDATE_NODE_ACCOUNT_NOT_ALLOWED"] = 359; + values[valuesById[360] = "TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY"] = 360; + values[valuesById[361] = "EMPTY_PENDING_AIRDROP_ID_LIST"] = 361; + values[valuesById[362] = "PENDING_AIRDROP_ID_REPEATED"] = 362; + values[valuesById[363] = "PENDING_AIRDROP_ID_LIST_TOO_LONG"] = 363; + values[valuesById[364] = "PENDING_NFT_AIRDROP_ALREADY_EXISTS"] = 364; + values[valuesById[365] = "ACCOUNT_HAS_PENDING_AIRDROPS"] = 365; + values[valuesById[366] = "THROTTLED_AT_CONSENSUS"] = 366; + values[valuesById[367] = "INVALID_PENDING_AIRDROP_ID"] = 367; + values[valuesById[368] = "TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY"] = 368; + values[valuesById[369] = "INVALID_TOKEN_IN_PENDING_AIRDROP"] = 369; + values[valuesById[370] = "SCHEDULE_EXPIRY_IS_BUSY"] = 370; + values[valuesById[371] = "INVALID_GRPC_CERTIFICATE_HASH"] = 371; + values[valuesById[372] = "MISSING_EXPIRY_TIME"] = 372; + values[valuesById[373] = "NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION"] = 373; + values[valuesById[374] = "RECURSIVE_SCHEDULING_LIMIT_REACHED"] = 374; + values[valuesById[375] = "WAITING_FOR_LEDGER_ID"] = 375; + values[valuesById[376] = "MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED"] = 376; + values[valuesById[377] = "FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS"] = 377; + values[valuesById[378] = "INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST"] = 378; + values[valuesById[379] = "INVALID_FEE_SCHEDULE_KEY"] = 379; + values[valuesById[380] = "FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED"] = 380; + values[valuesById[381] = "FEE_SCHEDULE_KEY_NOT_SET"] = 381; + values[valuesById[382] = "MAX_CUSTOM_FEE_LIMIT_EXCEEDED"] = 382; + values[valuesById[383] = "NO_VALID_MAX_CUSTOM_FEE"] = 383; + values[valuesById[384] = "INVALID_MAX_CUSTOM_FEES"] = 384; + values[valuesById[385] = "DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST"] = 385; + values[valuesById[386] = "DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST"] = 386; + values[valuesById[387] = "MAX_CUSTOM_FEES_IS_NOT_SUPPORTED"] = 387; + values[valuesById[388] = "BATCH_LIST_EMPTY"] = 388; + values[valuesById[389] = "BATCH_LIST_CONTAINS_DUPLICATES"] = 389; + values[valuesById[390] = "BATCH_TRANSACTION_IN_BLACKLIST"] = 390; + values[valuesById[391] = "INNER_TRANSACTION_FAILED"] = 391; + values[valuesById[392] = "MISSING_BATCH_KEY"] = 392; + values[valuesById[393] = "BATCH_KEY_SET_ON_NON_INNER_TRANSACTION"] = 393; + values[valuesById[394] = "INVALID_BATCH_KEY"] = 394; + values[valuesById[395] = "SCHEDULE_EXPIRY_NOT_CONFIGURABLE"] = 395; + values[valuesById[396] = "CREATING_SYSTEM_ENTITIES"] = 396; + values[valuesById[397] = "THROTTLE_GROUP_LCM_OVERFLOW"] = 397; + values[valuesById[398] = "AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN"] = 398; + values[valuesById[399] = "GRPC_WEB_PROXY_NOT_SUPPORTED"] = 399; + values[valuesById[400] = "NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE"] = 400; + return values; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/transaction_response.d.ts b/packages/proto/src/minimal/transaction_response.d.ts new file mode 100644 index 0000000000..d15a16c71c --- /dev/null +++ b/packages/proto/src/minimal/transaction_response.d.ts @@ -0,0 +1,1107 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = transaction_response; + +declare namespace transaction_response { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a TransactionResponse. */ + interface ITransactionResponse { + + /** + * A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + */ + nodeTransactionPrecheckCode?: (proto.ResponseCodeEnum|null); + + /** + * An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + */ + cost?: (Long|null); + } + + /** + * A message sent by a node in response to a transaction submission.
+ * This message only acknowledges that the individual node has checked + * the transaction, completed pre-check, and checked the fee offered. + * + * If the transaction fee is not sufficient, the `nodeTransactionPrecheckCode` + * value SHALL be `INSUFFICIENT_TX_FEE` and the `cost` field SHALL be the + * actual transaction fee, in tinybar, required.
+ * If the client requires acknowledgement of the network consensus result + * for a transaction, the client SHOULD request a transaction receipt or + * detailed transaction record. A client MAY also obtain network consensus + * results from a mirror node. + */ + class TransactionResponse implements ITransactionResponse { + + /** + * Constructs a new TransactionResponse. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionResponse); + + /** + * A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + */ + public nodeTransactionPrecheckCode: proto.ResponseCodeEnum; + + /** + * An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + */ + public cost: Long; + + /** + * Creates a new TransactionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionResponse instance + */ + public static create(properties?: proto.ITransactionResponse): proto.TransactionResponse; + + /** + * Encodes the specified TransactionResponse message. Does not implicitly {@link proto.TransactionResponse.verify|verify} messages. + * @param m TransactionResponse message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionResponse, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionResponse message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionResponse; + + /** + * Gets the default type url for TransactionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** An enumeration of possible response codes. */ + enum ResponseCodeEnum { + OK = 0, + INVALID_TRANSACTION = 1, + PAYER_ACCOUNT_NOT_FOUND = 2, + INVALID_NODE_ACCOUNT = 3, + TRANSACTION_EXPIRED = 4, + INVALID_TRANSACTION_START = 5, + INVALID_TRANSACTION_DURATION = 6, + INVALID_SIGNATURE = 7, + MEMO_TOO_LONG = 8, + INSUFFICIENT_TX_FEE = 9, + INSUFFICIENT_PAYER_BALANCE = 10, + DUPLICATE_TRANSACTION = 11, + BUSY = 12, + NOT_SUPPORTED = 13, + INVALID_FILE_ID = 14, + INVALID_ACCOUNT_ID = 15, + INVALID_CONTRACT_ID = 16, + INVALID_TRANSACTION_ID = 17, + RECEIPT_NOT_FOUND = 18, + RECORD_NOT_FOUND = 19, + INVALID_SOLIDITY_ID = 20, + UNKNOWN = 21, + SUCCESS = 22, + FAIL_INVALID = 23, + FAIL_FEE = 24, + FAIL_BALANCE = 25, + KEY_REQUIRED = 26, + BAD_ENCODING = 27, + INSUFFICIENT_ACCOUNT_BALANCE = 28, + INVALID_SOLIDITY_ADDRESS = 29, + INSUFFICIENT_GAS = 30, + CONTRACT_SIZE_LIMIT_EXCEEDED = 31, + LOCAL_CALL_MODIFICATION_EXCEPTION = 32, + CONTRACT_REVERT_EXECUTED = 33, + CONTRACT_EXECUTION_EXCEPTION = 34, + INVALID_RECEIVING_NODE_ACCOUNT = 35, + MISSING_QUERY_HEADER = 36, + ACCOUNT_UPDATE_FAILED = 37, + INVALID_KEY_ENCODING = 38, + NULL_SOLIDITY_ADDRESS = 39, + CONTRACT_UPDATE_FAILED = 40, + INVALID_QUERY_HEADER = 41, + INVALID_FEE_SUBMITTED = 42, + INVALID_PAYER_SIGNATURE = 43, + KEY_NOT_PROVIDED = 44, + INVALID_EXPIRATION_TIME = 45, + NO_WACL_KEY = 46, + FILE_CONTENT_EMPTY = 47, + INVALID_ACCOUNT_AMOUNTS = 48, + EMPTY_TRANSACTION_BODY = 49, + INVALID_TRANSACTION_BODY = 50, + INVALID_SIGNATURE_TYPE_MISMATCHING_KEY = 51, + INVALID_SIGNATURE_COUNT_MISMATCHING_KEY = 52, + EMPTY_LIVE_HASH_BODY = 53, + EMPTY_LIVE_HASH = 54, + EMPTY_LIVE_HASH_KEYS = 55, + INVALID_LIVE_HASH_SIZE = 56, + EMPTY_QUERY_BODY = 57, + EMPTY_LIVE_HASH_QUERY = 58, + LIVE_HASH_NOT_FOUND = 59, + ACCOUNT_ID_DOES_NOT_EXIST = 60, + LIVE_HASH_ALREADY_EXISTS = 61, + INVALID_FILE_WACL = 62, + SERIALIZATION_FAILED = 63, + TRANSACTION_OVERSIZE = 64, + TRANSACTION_TOO_MANY_LAYERS = 65, + CONTRACT_DELETED = 66, + PLATFORM_NOT_ACTIVE = 67, + KEY_PREFIX_MISMATCH = 68, + PLATFORM_TRANSACTION_NOT_CREATED = 69, + INVALID_RENEWAL_PERIOD = 70, + INVALID_PAYER_ACCOUNT_ID = 71, + ACCOUNT_DELETED = 72, + FILE_DELETED = 73, + ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS = 74, + SETTING_NEGATIVE_ACCOUNT_BALANCE = 75, + OBTAINER_REQUIRED = 76, + OBTAINER_SAME_CONTRACT_ID = 77, + OBTAINER_DOES_NOT_EXIST = 78, + MODIFYING_IMMUTABLE_CONTRACT = 79, + FILE_SYSTEM_EXCEPTION = 80, + AUTORENEW_DURATION_NOT_IN_RANGE = 81, + ERROR_DECODING_BYTESTRING = 82, + CONTRACT_FILE_EMPTY = 83, + CONTRACT_BYTECODE_EMPTY = 84, + INVALID_INITIAL_BALANCE = 85, + INVALID_RECEIVE_RECORD_THRESHOLD = 86, + INVALID_SEND_RECORD_THRESHOLD = 87, + ACCOUNT_IS_NOT_GENESIS_ACCOUNT = 88, + PAYER_ACCOUNT_UNAUTHORIZED = 89, + INVALID_FREEZE_TRANSACTION_BODY = 90, + FREEZE_TRANSACTION_BODY_NOT_FOUND = 91, + TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 92, + RESULT_SIZE_LIMIT_EXCEEDED = 93, + NOT_SPECIAL_ACCOUNT = 94, + CONTRACT_NEGATIVE_GAS = 95, + CONTRACT_NEGATIVE_VALUE = 96, + INVALID_FEE_FILE = 97, + INVALID_EXCHANGE_RATE_FILE = 98, + INSUFFICIENT_LOCAL_CALL_GAS = 99, + ENTITY_NOT_ALLOWED_TO_DELETE = 100, + AUTHORIZATION_FAILED = 101, + FILE_UPLOADED_PROTO_INVALID = 102, + FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK = 103, + FEE_SCHEDULE_FILE_PART_UPLOADED = 104, + EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED = 105, + MAX_CONTRACT_STORAGE_EXCEEDED = 106, + TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT = 107, + TOTAL_LEDGER_BALANCE_INVALID = 108, + EXPIRATION_REDUCTION_NOT_ALLOWED = 110, + MAX_GAS_LIMIT_EXCEEDED = 111, + MAX_FILE_SIZE_EXCEEDED = 112, + RECEIVER_SIG_REQUIRED = 113, + INVALID_TOPIC_ID = 150, + INVALID_ADMIN_KEY = 155, + INVALID_SUBMIT_KEY = 156, + UNAUTHORIZED = 157, + INVALID_TOPIC_MESSAGE = 158, + INVALID_AUTORENEW_ACCOUNT = 159, + AUTORENEW_ACCOUNT_NOT_ALLOWED = 160, + TOPIC_EXPIRED = 162, + INVALID_CHUNK_NUMBER = 163, + INVALID_CHUNK_TRANSACTION_ID = 164, + ACCOUNT_FROZEN_FOR_TOKEN = 165, + TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED = 166, + INVALID_TOKEN_ID = 167, + INVALID_TOKEN_DECIMALS = 168, + INVALID_TOKEN_INITIAL_SUPPLY = 169, + INVALID_TREASURY_ACCOUNT_FOR_TOKEN = 170, + INVALID_TOKEN_SYMBOL = 171, + TOKEN_HAS_NO_FREEZE_KEY = 172, + TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN = 173, + MISSING_TOKEN_SYMBOL = 174, + TOKEN_SYMBOL_TOO_LONG = 175, + ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN = 176, + TOKEN_HAS_NO_KYC_KEY = 177, + INSUFFICIENT_TOKEN_BALANCE = 178, + TOKEN_WAS_DELETED = 179, + TOKEN_HAS_NO_SUPPLY_KEY = 180, + TOKEN_HAS_NO_WIPE_KEY = 181, + INVALID_TOKEN_MINT_AMOUNT = 182, + INVALID_TOKEN_BURN_AMOUNT = 183, + TOKEN_NOT_ASSOCIATED_TO_ACCOUNT = 184, + CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT = 185, + INVALID_KYC_KEY = 186, + INVALID_WIPE_KEY = 187, + INVALID_FREEZE_KEY = 188, + INVALID_SUPPLY_KEY = 189, + MISSING_TOKEN_NAME = 190, + TOKEN_NAME_TOO_LONG = 191, + INVALID_WIPING_AMOUNT = 192, + TOKEN_IS_IMMUTABLE = 193, + TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT = 194, + TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES = 195, + ACCOUNT_IS_TREASURY = 196, + TOKEN_ID_REPEATED_IN_TOKEN_LIST = 197, + TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED = 198, + EMPTY_TOKEN_TRANSFER_BODY = 199, + EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS = 200, + INVALID_SCHEDULE_ID = 201, + SCHEDULE_IS_IMMUTABLE = 202, + INVALID_SCHEDULE_PAYER_ID = 203, + INVALID_SCHEDULE_ACCOUNT_ID = 204, + NO_NEW_VALID_SIGNATURES = 205, + UNRESOLVABLE_REQUIRED_SIGNERS = 206, + SCHEDULED_TRANSACTION_NOT_IN_WHITELIST = 207, + SOME_SIGNATURES_WERE_INVALID = 208, + TRANSACTION_ID_FIELD_NOT_ALLOWED = 209, + IDENTICAL_SCHEDULE_ALREADY_CREATED = 210, + INVALID_ZERO_BYTE_IN_STRING = 211, + SCHEDULE_ALREADY_DELETED = 212, + SCHEDULE_ALREADY_EXECUTED = 213, + MESSAGE_SIZE_TOO_LARGE = 214, + OPERATION_REPEATED_IN_BUCKET_GROUPS = 215, + BUCKET_CAPACITY_OVERFLOW = 216, + NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION = 217, + BUCKET_HAS_NO_THROTTLE_GROUPS = 218, + THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC = 219, + SUCCESS_BUT_MISSING_EXPECTED_OPERATION = 220, + UNPARSEABLE_THROTTLE_DEFINITIONS = 221, + INVALID_THROTTLE_DEFINITIONS = 222, + ACCOUNT_EXPIRED_AND_PENDING_REMOVAL = 223, + INVALID_TOKEN_MAX_SUPPLY = 224, + INVALID_TOKEN_NFT_SERIAL_NUMBER = 225, + INVALID_NFT_ID = 226, + METADATA_TOO_LONG = 227, + BATCH_SIZE_LIMIT_EXCEEDED = 228, + INVALID_QUERY_RANGE = 229, + FRACTION_DIVIDES_BY_ZERO = 230, + INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE = 231, + CUSTOM_FEES_LIST_TOO_LONG = 232, + INVALID_CUSTOM_FEE_COLLECTOR = 233, + INVALID_TOKEN_ID_IN_CUSTOM_FEES = 234, + TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR = 235, + TOKEN_MAX_SUPPLY_REACHED = 236, + SENDER_DOES_NOT_OWN_NFT_SERIAL_NO = 237, + CUSTOM_FEE_NOT_FULLY_SPECIFIED = 238, + CUSTOM_FEE_MUST_BE_POSITIVE = 239, + TOKEN_HAS_NO_FEE_SCHEDULE_KEY = 240, + CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE = 241, + ROYALTY_FRACTION_CANNOT_EXCEED_ONE = 242, + FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT = 243, + CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES = 244, + CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON = 245, + CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 246, + INVALID_CUSTOM_FEE_SCHEDULE_KEY = 247, + INVALID_TOKEN_MINT_METADATA = 248, + INVALID_TOKEN_BURN_METADATA = 249, + CURRENT_TREASURY_STILL_OWNS_NFTS = 250, + ACCOUNT_STILL_OWNS_NFTS = 251, + TREASURY_MUST_OWN_BURNED_NFT = 252, + ACCOUNT_DOES_NOT_OWN_WIPED_NFT = 253, + ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON = 254, + MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED = 255, + PAYER_ACCOUNT_DELETED = 256, + CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH = 257, + CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS = 258, + INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE = 259, + SERIAL_NUMBER_LIMIT_REACHED = 260, + CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = 261, + NO_REMAINING_AUTOMATIC_ASSOCIATIONS = 262, + EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT = 263, + REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT = 264, + TOKEN_IS_PAUSED = 265, + TOKEN_HAS_NO_PAUSE_KEY = 266, + INVALID_PAUSE_KEY = 267, + FREEZE_UPDATE_FILE_DOES_NOT_EXIST = 268, + FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH = 269, + NO_UPGRADE_HAS_BEEN_PREPARED = 270, + NO_FREEZE_IS_SCHEDULED = 271, + UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE = 272, + FREEZE_START_TIME_MUST_BE_FUTURE = 273, + PREPARED_UPDATE_FILE_IS_IMMUTABLE = 274, + FREEZE_ALREADY_SCHEDULED = 275, + FREEZE_UPGRADE_IN_PROGRESS = 276, + UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED = 277, + UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED = 278, + CONSENSUS_GAS_EXHAUSTED = 279, + REVERTED_SUCCESS = 280, + MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED = 281, + INVALID_ALIAS_KEY = 282, + UNEXPECTED_TOKEN_DECIMALS = 283, + INVALID_PROXY_ACCOUNT_ID = 284, + INVALID_TRANSFER_ACCOUNT_ID = 285, + INVALID_FEE_COLLECTOR_ACCOUNT_ID = 286, + ALIAS_IS_IMMUTABLE = 287, + SPENDER_ACCOUNT_SAME_AS_OWNER = 288, + AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY = 289, + NEGATIVE_ALLOWANCE_AMOUNT = 290, + CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON = 291, + SPENDER_DOES_NOT_HAVE_ALLOWANCE = 292, + AMOUNT_EXCEEDS_ALLOWANCE = 293, + MAX_ALLOWANCES_EXCEEDED = 294, + EMPTY_ALLOWANCES = 295, + SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES = 296, + REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES = 297, + FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES = 298, + NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES = 299, + INVALID_ALLOWANCE_OWNER_ID = 300, + INVALID_ALLOWANCE_SPENDER_ID = 301, + REPEATED_ALLOWANCES_TO_DELETE = 302, + INVALID_DELEGATING_SPENDER = 303, + DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL = 304, + DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL = 305, + SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE = 306, + SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME = 307, + SCHEDULE_FUTURE_THROTTLE_EXCEEDED = 308, + SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED = 309, + INVALID_ETHEREUM_TRANSACTION = 310, + WRONG_CHAIN_ID = 311, + WRONG_NONCE = 312, + ACCESS_LIST_UNSUPPORTED = 313, + SCHEDULE_PENDING_EXPIRATION = 314, + CONTRACT_IS_TOKEN_TREASURY = 315, + CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES = 316, + CONTRACT_EXPIRED_AND_PENDING_REMOVAL = 317, + CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT = 318, + PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION = 319, + PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED = 320, + SELF_STAKING_IS_NOT_ALLOWED = 321, + INVALID_STAKING_ID = 322, + STAKING_NOT_ENABLED = 323, + INVALID_PRNG_RANGE = 324, + MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED = 325, + INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE = 326, + INSUFFICIENT_BALANCES_FOR_STORAGE_RENT = 327, + MAX_CHILD_RECORDS_EXCEEDED = 328, + INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES = 329, + TRANSACTION_HAS_UNKNOWN_FIELDS = 330, + ACCOUNT_IS_IMMUTABLE = 331, + ALIAS_ALREADY_ASSIGNED = 332, + INVALID_METADATA_KEY = 333, + TOKEN_HAS_NO_METADATA_KEY = 334, + MISSING_TOKEN_METADATA = 335, + MISSING_SERIAL_NUMBERS = 336, + TOKEN_HAS_NO_ADMIN_KEY = 337, + NODE_DELETED = 338, + INVALID_NODE_ID = 339, + INVALID_GOSSIP_ENDPOINT = 340, + INVALID_NODE_ACCOUNT_ID = 341, + INVALID_NODE_DESCRIPTION = 342, + INVALID_SERVICE_ENDPOINT = 343, + INVALID_GOSSIP_CA_CERTIFICATE = 344, + INVALID_GRPC_CERTIFICATE = 345, + INVALID_MAX_AUTO_ASSOCIATIONS = 346, + MAX_NODES_CREATED = 347, + IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT = 348, + GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN = 349, + FQDN_SIZE_TOO_LARGE = 350, + INVALID_ENDPOINT = 351, + GOSSIP_ENDPOINTS_EXCEEDED_LIMIT = 352, + TOKEN_REFERENCE_REPEATED = 353, + INVALID_OWNER_ID = 354, + TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED = 355, + SERVICE_ENDPOINTS_EXCEEDED_LIMIT = 356, + INVALID_IPV4_ADDRESS = 357, + EMPTY_TOKEN_REFERENCE_LIST = 358, + UPDATE_NODE_ACCOUNT_NOT_ALLOWED = 359, + TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY = 360, + EMPTY_PENDING_AIRDROP_ID_LIST = 361, + PENDING_AIRDROP_ID_REPEATED = 362, + PENDING_AIRDROP_ID_LIST_TOO_LONG = 363, + PENDING_NFT_AIRDROP_ALREADY_EXISTS = 364, + ACCOUNT_HAS_PENDING_AIRDROPS = 365, + THROTTLED_AT_CONSENSUS = 366, + INVALID_PENDING_AIRDROP_ID = 367, + TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY = 368, + INVALID_TOKEN_IN_PENDING_AIRDROP = 369, + SCHEDULE_EXPIRY_IS_BUSY = 370, + INVALID_GRPC_CERTIFICATE_HASH = 371, + MISSING_EXPIRY_TIME = 372, + NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION = 373, + RECURSIVE_SCHEDULING_LIMIT_REACHED = 374, + WAITING_FOR_LEDGER_ID = 375, + MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED = 376, + FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS = 377, + INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST = 378, + INVALID_FEE_SCHEDULE_KEY = 379, + FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED = 380, + FEE_SCHEDULE_KEY_NOT_SET = 381, + MAX_CUSTOM_FEE_LIMIT_EXCEEDED = 382, + NO_VALID_MAX_CUSTOM_FEE = 383, + INVALID_MAX_CUSTOM_FEES = 384, + DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST = 385, + DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST = 386, + MAX_CUSTOM_FEES_IS_NOT_SUPPORTED = 387, + BATCH_LIST_EMPTY = 388, + BATCH_LIST_CONTAINS_DUPLICATES = 389, + BATCH_TRANSACTION_IN_BLACKLIST = 390, + INNER_TRANSACTION_FAILED = 391, + MISSING_BATCH_KEY = 392, + BATCH_KEY_SET_ON_NON_INNER_TRANSACTION = 393, + INVALID_BATCH_KEY = 394, + SCHEDULE_EXPIRY_NOT_CONFIGURABLE = 395, + CREATING_SYSTEM_ENTITIES = 396, + THROTTLE_GROUP_LCM_OVERFLOW = 397, + AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN = 398, + GRPC_WEB_PROXY_NOT_SUPPORTED = 399, + NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE = 400 + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/transaction_response.js b/packages/proto/src/minimal/transaction_response.js new file mode 100644 index 0000000000..7dba0fe2b8 --- /dev/null +++ b/packages/proto/src/minimal/transaction_response.js @@ -0,0 +1,2277 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.transaction_response || ($protobuf.roots.transaction_response = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.TransactionResponse = (function() { + + /** + * Properties of a TransactionResponse. + * @memberof proto + * @interface ITransactionResponse + * @property {proto.ResponseCodeEnum|null} [nodeTransactionPrecheckCode] A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + * @property {Long|null} [cost] An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + */ + + /** + * Constructs a new TransactionResponse. + * @memberof proto + * @classdesc A message sent by a node in response to a transaction submission.
+ * This message only acknowledges that the individual node has checked + * the transaction, completed pre-check, and checked the fee offered. + * + * If the transaction fee is not sufficient, the `nodeTransactionPrecheckCode` + * value SHALL be `INSUFFICIENT_TX_FEE` and the `cost` field SHALL be the + * actual transaction fee, in tinybar, required.
+ * If the client requires acknowledgement of the network consensus result + * for a transaction, the client SHOULD request a transaction receipt or + * detailed transaction record. A client MAY also obtain network consensus + * results from a mirror node. + * @implements ITransactionResponse + * @constructor + * @param {proto.ITransactionResponse=} [p] Properties to set + */ + function TransactionResponse(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A pre-consensus response code. + *

+ * This response SHALL represent the response of the individual node, and + * SHALL NOT represent the consensus of the network. + * @member {proto.ResponseCodeEnum} nodeTransactionPrecheckCode + * @memberof proto.TransactionResponse + * @instance + */ + TransactionResponse.prototype.nodeTransactionPrecheckCode = 0; + + /** + * An approximate transaction fee. + *

+ * This value SHALL be `0` unless the `nodeTransactionPrecheckCode` is + * `INSUFFICIENT_TX_FEE`.
+ * This value SHOULD be an amount, in tinybar, that _would have_ succeeded + * at the time the transaction was submitted.
+ * Note that this amount is not guaranteed to succeed in a future + * transaction due to uncontrolled variables, such as network congestion, + * but should be considered a close approximation. + * @member {Long} cost + * @memberof proto.TransactionResponse + * @instance + */ + TransactionResponse.prototype.cost = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new TransactionResponse instance using the specified properties. + * @function create + * @memberof proto.TransactionResponse + * @static + * @param {proto.ITransactionResponse=} [properties] Properties to set + * @returns {proto.TransactionResponse} TransactionResponse instance + */ + TransactionResponse.create = function create(properties) { + return new TransactionResponse(properties); + }; + + /** + * Encodes the specified TransactionResponse message. Does not implicitly {@link proto.TransactionResponse.verify|verify} messages. + * @function encode + * @memberof proto.TransactionResponse + * @static + * @param {proto.ITransactionResponse} m TransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionResponse.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeTransactionPrecheckCode != null && Object.hasOwnProperty.call(m, "nodeTransactionPrecheckCode")) + w.uint32(8).int32(m.nodeTransactionPrecheckCode); + if (m.cost != null && Object.hasOwnProperty.call(m, "cost")) + w.uint32(16).uint64(m.cost); + return w; + }; + + /** + * Decodes a TransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionResponse} TransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionResponse.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionResponse(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodeTransactionPrecheckCode = r.int32(); + break; + } + case 2: { + m.cost = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionResponse + * @function getTypeUrl + * @memberof proto.TransactionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionResponse"; + }; + + return TransactionResponse; + })(); + + /** + * An enumeration of possible response codes. + * @name proto.ResponseCodeEnum + * @enum {number} + * @property {number} OK=0 The transaction passed the precheck validations. + * @property {number} INVALID_TRANSACTION=1 For any error not handled by specific error codes listed below. + * @property {number} PAYER_ACCOUNT_NOT_FOUND=2 Payer account does not exist. + * @property {number} INVALID_NODE_ACCOUNT=3 Node Account provided does not match the node account of the node the transaction was submitted + * to. + * @property {number} TRANSACTION_EXPIRED=4 Pre-Check error when TransactionValidStart + transactionValidDuration is less than current + * consensus time. + * @property {number} INVALID_TRANSACTION_START=5 Transaction start time is greater than current consensus time + * @property {number} INVALID_TRANSACTION_DURATION=6 The given transactionValidDuration was either non-positive, or greater than the maximum + * valid duration of 180 secs. + * @property {number} INVALID_SIGNATURE=7 The transaction signature is not valid + * @property {number} MEMO_TOO_LONG=8 Transaction memo size exceeded 100 bytes + * @property {number} INSUFFICIENT_TX_FEE=9 The fee provided in the transaction is insufficient for this type of transaction + * @property {number} INSUFFICIENT_PAYER_BALANCE=10 The payer account has insufficient cryptocurrency to pay the transaction fee + * @property {number} 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) + * @property {number} BUSY=12 If API is throttled out + * @property {number} NOT_SUPPORTED=13 The API is not currently supported + * @property {number} INVALID_FILE_ID=14 The file id is invalid or does not exist + * @property {number} INVALID_ACCOUNT_ID=15 The account id is invalid or does not exist + * @property {number} INVALID_CONTRACT_ID=16 The contract id is invalid or does not exist + * @property {number} INVALID_TRANSACTION_ID=17 Transaction id is not valid + * @property {number} RECEIPT_NOT_FOUND=18 Receipt for given transaction id does not exist + * @property {number} RECORD_NOT_FOUND=19 Record for given transaction id does not exist + * @property {number} INVALID_SOLIDITY_ID=20 The solidity id is invalid or entity with this solidity id does not exist + * @property {number} UNKNOWN=21 The responding node has submitted the transaction to the network. Its final status is still + * unknown. + * @property {number} SUCCESS=22 The transaction succeeded + * @property {number} FAIL_INVALID=23 There was a system error and the transaction failed because of invalid request parameters. + * @property {number} FAIL_FEE=24 There was a system error while performing fee calculation, reserved for future. + * @property {number} FAIL_BALANCE=25 There was a system error while performing balance checks, reserved for future. + * @property {number} KEY_REQUIRED=26 Key not provided in the transaction body + * @property {number} BAD_ENCODING=27 Unsupported algorithm/encoding used for keys in the transaction + * @property {number} INSUFFICIENT_ACCOUNT_BALANCE=28 When the account balance is not sufficient for the transfer + * @property {number} INVALID_SOLIDITY_ADDRESS=29 During an update transaction when the system is not able to find the Users Solidity address + * @property {number} INSUFFICIENT_GAS=30 Not enough gas was supplied to execute transaction + * @property {number} CONTRACT_SIZE_LIMIT_EXCEEDED=31 contract byte code size is over the limit + * @property {number} LOCAL_CALL_MODIFICATION_EXCEPTION=32 local execution (query) is requested for a function which changes state + * @property {number} CONTRACT_REVERT_EXECUTED=33 Contract REVERT OPCODE executed + * @property {number} CONTRACT_EXECUTION_EXCEPTION=34 For any contract execution related error not handled by specific error codes listed above. + * @property {number} 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 + * @property {number} MISSING_QUERY_HEADER=36 Header is missing in Query request + * @property {number} ACCOUNT_UPDATE_FAILED=37 The update of the account failed + * @property {number} INVALID_KEY_ENCODING=38 Provided key encoding was not supported by the system + * @property {number} NULL_SOLIDITY_ADDRESS=39 null solidity address + * @property {number} CONTRACT_UPDATE_FAILED=40 update of the contract failed + * @property {number} INVALID_QUERY_HEADER=41 the query header is invalid + * @property {number} INVALID_FEE_SUBMITTED=42 Invalid fee submitted + * @property {number} INVALID_PAYER_SIGNATURE=43 Payer signature is invalid + * @property {number} KEY_NOT_PROVIDED=44 The keys were not provided in the request. + * @property {number} INVALID_EXPIRATION_TIME=45 Expiration time provided in the transaction was invalid. + * @property {number} NO_WACL_KEY=46 WriteAccess Control Keys are not provided for the file + * @property {number} FILE_CONTENT_EMPTY=47 The contents of file are provided as empty. + * @property {number} INVALID_ACCOUNT_AMOUNTS=48 The crypto transfer credit and debit do not sum equal to 0 + * @property {number} EMPTY_TRANSACTION_BODY=49 Transaction body provided is empty + * @property {number} INVALID_TRANSACTION_BODY=50 Invalid transaction body provided + * @property {number} 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) + * @property {number} 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. + * @property {number} EMPTY_LIVE_HASH_BODY=53 the livehash body is empty + * @property {number} EMPTY_LIVE_HASH=54 the livehash data is missing + * @property {number} EMPTY_LIVE_HASH_KEYS=55 the keys for a livehash are missing + * @property {number} INVALID_LIVE_HASH_SIZE=56 the livehash data is not the output of a SHA-384 digest + * @property {number} EMPTY_QUERY_BODY=57 the query body is empty + * @property {number} EMPTY_LIVE_HASH_QUERY=58 the crypto livehash query is empty + * @property {number} LIVE_HASH_NOT_FOUND=59 the livehash is not present + * @property {number} ACCOUNT_ID_DOES_NOT_EXIST=60 the account id passed has not yet been created. + * @property {number} LIVE_HASH_ALREADY_EXISTS=61 the livehash already exists for a given account + * @property {number} INVALID_FILE_WACL=62 File WACL keys are invalid + * @property {number} SERIALIZATION_FAILED=63 Serialization failure + * @property {number} TRANSACTION_OVERSIZE=64 The size of the Transaction is greater than transactionMaxBytes + * @property {number} TRANSACTION_TOO_MANY_LAYERS=65 The Transaction has more than 50 levels + * @property {number} CONTRACT_DELETED=66 Contract is marked as deleted + * @property {number} PLATFORM_NOT_ACTIVE=67 the platform node is either disconnected or lagging behind. + * @property {number} KEY_PREFIX_MISMATCH=68 one public key matches more than one prefixes on the signature map + * @property {number} PLATFORM_TRANSACTION_NOT_CREATED=69 transaction not created by platform due to large backlog + * @property {number} INVALID_RENEWAL_PERIOD=70 auto renewal period is not a positive number of seconds + * @property {number} INVALID_PAYER_ACCOUNT_ID=71 the response code when a smart contract id is passed for a crypto API request + * @property {number} ACCOUNT_DELETED=72 the account has been marked as deleted + * @property {number} FILE_DELETED=73 the file has been marked as deleted + * @property {number} ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS=74 same accounts repeated in the transfer account list + * @property {number} SETTING_NEGATIVE_ACCOUNT_BALANCE=75 attempting to set negative balance value for crypto account + * @property {number} OBTAINER_REQUIRED=76 when deleting smart contract that has crypto balance either transfer account or transfer smart + * contract is required + * @property {number} 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 + * @property {number} OBTAINER_DOES_NOT_EXIST=78 transferAccountId or transferContractId specified for contract delete does not exist + * @property {number} MODIFYING_IMMUTABLE_CONTRACT=79 attempting to modify (update or delete a immutable smart contract, i.e. one created without a + * admin key) + * @property {number} FILE_SYSTEM_EXCEPTION=80 Unexpected exception thrown by file system functions + * @property {number} AUTORENEW_DURATION_NOT_IN_RANGE=81 the duration is not a subset of [MINIMUM_AUTORENEW_DURATION,MAXIMUM_AUTORENEW_DURATION] + * @property {number} ERROR_DECODING_BYTESTRING=82 Decoding the smart contract binary to a byte array failed. Check that the input is a valid hex + * string. + * @property {number} CONTRACT_FILE_EMPTY=83 File to create a smart contract was of length zero + * @property {number} CONTRACT_BYTECODE_EMPTY=84 Bytecode for smart contract is of length zero + * @property {number} INVALID_INITIAL_BALANCE=85 Attempt to set negative initial balance + * @property {number} INVALID_RECEIVE_RECORD_THRESHOLD=86 Attempt to set negative receive record threshold + * @property {number} INVALID_SEND_RECORD_THRESHOLD=87 Attempt to set negative send record threshold + * @property {number} 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 + * @property {number} PAYER_ACCOUNT_UNAUTHORIZED=89 The fee payer account doesn't have permission to submit such Transaction + * @property {number} INVALID_FREEZE_TRANSACTION_BODY=90 FreezeTransactionBody is invalid + * @property {number} FREEZE_TRANSACTION_BODY_NOT_FOUND=91 FreezeTransactionBody does not exist + * @property {number} TRANSFER_LIST_SIZE_LIMIT_EXCEEDED=92 Exceeded the number of accounts (both from and to) allowed for crypto transfer list + * @property {number} RESULT_SIZE_LIMIT_EXCEEDED=93 Smart contract result size greater than specified maxResultSize + * @property {number} NOT_SPECIAL_ACCOUNT=94 The payer account is not a special account(account 0.0.55) + * @property {number} CONTRACT_NEGATIVE_GAS=95 Negative gas was offered in smart contract call + * @property {number} CONTRACT_NEGATIVE_VALUE=96 Negative value / initial balance was specified in a smart contract call / create + * @property {number} INVALID_FEE_FILE=97 Failed to update fee file + * @property {number} INVALID_EXCHANGE_RATE_FILE=98 Failed to update exchange rate file + * @property {number} INSUFFICIENT_LOCAL_CALL_GAS=99 Payment tendered for contract local call cannot cover both the fee and the gas + * @property {number} ENTITY_NOT_ALLOWED_TO_DELETE=100 Entities with Entity ID below 1000 are not allowed to be deleted + * @property {number} 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). + * @property {number} FILE_UPLOADED_PROTO_INVALID=102 Fee Schedule Proto uploaded but not valid (append or update is required) + * @property {number} FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK=103 Fee Schedule Proto uploaded but not valid (append or update is required) + * @property {number} FEE_SCHEDULE_FILE_PART_UPLOADED=104 Fee Schedule Proto File Part uploaded + * @property {number} EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED=105 The change on Exchange Rate exceeds Exchange_Rate_Allowed_Percentage + * @property {number} MAX_CONTRACT_STORAGE_EXCEEDED=106 Contract permanent storage exceeded the currently allowable limit + * @property {number} TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT=107 Transfer Account should not be same as Account to be deleted + * @property {number} TOTAL_LEDGER_BALANCE_INVALID=108 TOTAL_LEDGER_BALANCE_INVALID value + * @property {number} EXPIRATION_REDUCTION_NOT_ALLOWED=110 The expiration date/time on a smart contract may not be reduced + * @property {number} MAX_GAS_LIMIT_EXCEEDED=111 Gas exceeded currently allowable gas limit per transaction + * @property {number} MAX_FILE_SIZE_EXCEEDED=112 File size exceeded the currently allowable limit + * @property {number} RECEIVER_SIG_REQUIRED=113 When a valid signature is not provided for operations on account with receiverSigRequired=true + * @property {number} INVALID_TOPIC_ID=150 The Topic ID specified is not in the system. + * @property {number} INVALID_ADMIN_KEY=155 A provided admin key was invalid. Verify the bytes for an Ed25519 public key are exactly 32 bytes; and the bytes for a compressed ECDSA(secp256k1) key are exactly 33 bytes, with the first byte either 0x02 or 0x03.. + * @property {number} INVALID_SUBMIT_KEY=156 A provided submit key was invalid. + * @property {number} UNAUTHORIZED=157 An attempted operation was not authorized (ie - a deleteTopic for a topic with no adminKey). + * @property {number} INVALID_TOPIC_MESSAGE=158 A ConsensusService message is empty. + * @property {number} INVALID_AUTORENEW_ACCOUNT=159 The autoRenewAccount specified is not a valid, active account. + * @property {number} AUTORENEW_ACCOUNT_NOT_ALLOWED=160 An adminKey was not specified on the topic, so there must not be an autoRenewAccount. + * @property {number} TOPIC_EXPIRED=162 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. + * @property {number} INVALID_CHUNK_NUMBER=163 INVALID_CHUNK_NUMBER value + * @property {number} INVALID_CHUNK_TRANSACTION_ID=164 INVALID_CHUNK_TRANSACTION_ID value + * @property {number} ACCOUNT_FROZEN_FOR_TOKEN=165 ACCOUNT_FROZEN_FOR_TOKEN value + * @property {number} TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED=166 TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED value + * @property {number} INVALID_TOKEN_ID=167 INVALID_TOKEN_ID value + * @property {number} INVALID_TOKEN_DECIMALS=168 INVALID_TOKEN_DECIMALS value + * @property {number} INVALID_TOKEN_INITIAL_SUPPLY=169 INVALID_TOKEN_INITIAL_SUPPLY value + * @property {number} INVALID_TREASURY_ACCOUNT_FOR_TOKEN=170 INVALID_TREASURY_ACCOUNT_FOR_TOKEN value + * @property {number} INVALID_TOKEN_SYMBOL=171 INVALID_TOKEN_SYMBOL value + * @property {number} TOKEN_HAS_NO_FREEZE_KEY=172 TOKEN_HAS_NO_FREEZE_KEY value + * @property {number} TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN=173 TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN value + * @property {number} MISSING_TOKEN_SYMBOL=174 MISSING_TOKEN_SYMBOL value + * @property {number} TOKEN_SYMBOL_TOO_LONG=175 TOKEN_SYMBOL_TOO_LONG value + * @property {number} ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN=176 ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN value + * @property {number} TOKEN_HAS_NO_KYC_KEY=177 TOKEN_HAS_NO_KYC_KEY value + * @property {number} INSUFFICIENT_TOKEN_BALANCE=178 INSUFFICIENT_TOKEN_BALANCE value + * @property {number} TOKEN_WAS_DELETED=179 TOKEN_WAS_DELETED value + * @property {number} TOKEN_HAS_NO_SUPPLY_KEY=180 TOKEN_HAS_NO_SUPPLY_KEY value + * @property {number} TOKEN_HAS_NO_WIPE_KEY=181 TOKEN_HAS_NO_WIPE_KEY value + * @property {number} INVALID_TOKEN_MINT_AMOUNT=182 INVALID_TOKEN_MINT_AMOUNT value + * @property {number} INVALID_TOKEN_BURN_AMOUNT=183 INVALID_TOKEN_BURN_AMOUNT value + * @property {number} TOKEN_NOT_ASSOCIATED_TO_ACCOUNT=184 TOKEN_NOT_ASSOCIATED_TO_ACCOUNT value + * @property {number} CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT=185 CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT value + * @property {number} INVALID_KYC_KEY=186 INVALID_KYC_KEY value + * @property {number} INVALID_WIPE_KEY=187 INVALID_WIPE_KEY value + * @property {number} INVALID_FREEZE_KEY=188 INVALID_FREEZE_KEY value + * @property {number} INVALID_SUPPLY_KEY=189 INVALID_SUPPLY_KEY value + * @property {number} MISSING_TOKEN_NAME=190 MISSING_TOKEN_NAME value + * @property {number} TOKEN_NAME_TOO_LONG=191 TOKEN_NAME_TOO_LONG value + * @property {number} INVALID_WIPING_AMOUNT=192 INVALID_WIPING_AMOUNT value + * @property {number} TOKEN_IS_IMMUTABLE=193 TOKEN_IS_IMMUTABLE value + * @property {number} TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT=194 TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT value + * @property {number} TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES=195 TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES value + * @property {number} ACCOUNT_IS_TREASURY=196 ACCOUNT_IS_TREASURY value + * @property {number} TOKEN_ID_REPEATED_IN_TOKEN_LIST=197 TOKEN_ID_REPEATED_IN_TOKEN_LIST value + * @property {number} TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED=198 TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED value + * @property {number} EMPTY_TOKEN_TRANSFER_BODY=199 EMPTY_TOKEN_TRANSFER_BODY value + * @property {number} EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS=200 EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS value + * @property {number} INVALID_SCHEDULE_ID=201 The Scheduled entity does not exist; or has now expired, been deleted, or been executed + * @property {number} SCHEDULE_IS_IMMUTABLE=202 The Scheduled entity cannot be modified. Admin key not set + * @property {number} INVALID_SCHEDULE_PAYER_ID=203 The provided Scheduled Payer does not exist + * @property {number} INVALID_SCHEDULE_ACCOUNT_ID=204 The Schedule Create Transaction TransactionID account does not exist + * @property {number} NO_NEW_VALID_SIGNATURES=205 The provided sig map did not contain any new valid signatures from required signers of the scheduled transaction + * @property {number} 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 + * @property {number} SCHEDULED_TRANSACTION_NOT_IN_WHITELIST=207 Only whitelisted transaction types may be scheduled + * @property {number} 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 + * @property {number} TRANSACTION_ID_FIELD_NOT_ALLOWED=209 The scheduled field in the TransactionID may not be set to true + * @property {number} 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) + * @property {number} INVALID_ZERO_BYTE_IN_STRING=211 A string field in the transaction has a UTF-8 encoding with the prohibited zero byte + * @property {number} SCHEDULE_ALREADY_DELETED=212 A schedule being signed or deleted has already been deleted + * @property {number} SCHEDULE_ALREADY_EXECUTED=213 A schedule being signed or deleted has already been executed + * @property {number} MESSAGE_SIZE_TOO_LARGE=214 ConsensusSubmitMessage request's message size is larger than allowed. + * @property {number} OPERATION_REPEATED_IN_BUCKET_GROUPS=215 An operation was assigned to more than one throttle group in a given bucket + * @property {number} BUCKET_CAPACITY_OVERFLOW=216 The capacity needed to satisfy all opsPerSec groups in a bucket overflowed a signed 8-byte integral type + * @property {number} 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 + * @property {number} BUCKET_HAS_NO_THROTTLE_GROUPS=218 A bucket was defined without any throttle groups + * @property {number} THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC=219 A throttle group was granted zero opsPerSec + * @property {number} SUCCESS_BUT_MISSING_EXPECTED_OPERATION=220 The throttle definitions file was updated, but some supported operations were not assigned a bucket + * @property {number} UNPARSEABLE_THROTTLE_DEFINITIONS=221 The new contents for the throttle definitions system file were not valid protobuf + * @property {number} INVALID_THROTTLE_DEFINITIONS=222 The new throttle definitions system file were invalid, and no more specific error could be divined + * @property {number} 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 + * @property {number} INVALID_TOKEN_MAX_SUPPLY=224 Invalid token max supply + * @property {number} INVALID_TOKEN_NFT_SERIAL_NUMBER=225 Invalid token nft serial number + * @property {number} INVALID_NFT_ID=226 Invalid nft id + * @property {number} METADATA_TOO_LONG=227 Nft metadata is too long + * @property {number} BATCH_SIZE_LIMIT_EXCEEDED=228 Repeated operations count exceeds the limit + * @property {number} INVALID_QUERY_RANGE=229 The range of data to be gathered is out of the set boundaries + * @property {number} FRACTION_DIVIDES_BY_ZERO=230 A custom fractional fee set a denominator of zero + * @property {number} INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE=231 The transaction payer could not afford a custom fee + * @property {number} CUSTOM_FEES_LIST_TOO_LONG=232 More than 10 custom fees were specified + * @property {number} INVALID_CUSTOM_FEE_COLLECTOR=233 Any of the feeCollector accounts for customFees is invalid + * @property {number} INVALID_TOKEN_ID_IN_CUSTOM_FEES=234 Any of the token Ids in customFees is invalid + * @property {number} TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR=235 Any of the token Ids in customFees are not associated to feeCollector + * @property {number} TOKEN_MAX_SUPPLY_REACHED=236 A token cannot have more units minted due to its configured supply ceiling + * @property {number} SENDER_DOES_NOT_OWN_NFT_SERIAL_NO=237 The transaction attempted to move an NFT serial number from an account other than its owner + * @property {number} CUSTOM_FEE_NOT_FULLY_SPECIFIED=238 A custom fee schedule entry did not specify either a fixed or fractional fee + * @property {number} CUSTOM_FEE_MUST_BE_POSITIVE=239 Only positive fees may be assessed at this time + * @property {number} TOKEN_HAS_NO_FEE_SCHEDULE_KEY=240 Fee schedule key is not set on token + * @property {number} CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE=241 A fractional custom fee exceeded the range of a 64-bit signed integer + * @property {number} ROYALTY_FRACTION_CANNOT_EXCEED_ONE=242 A royalty cannot exceed the total fungible value exchanged for an NFT + * @property {number} FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT=243 Each fractional custom fee must have its maximum_amount, if specified, at least its minimum_amount + * @property {number} CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES=244 A fee schedule update tried to clear the custom fees from a token whose fee schedule was already empty + * @property {number} CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON=245 Only tokens of type FUNGIBLE_COMMON can be used to as fee schedule denominations + * @property {number} CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON=246 Only tokens of type FUNGIBLE_COMMON can have fractional fees + * @property {number} INVALID_CUSTOM_FEE_SCHEDULE_KEY=247 The provided custom fee schedule key was invalid + * @property {number} INVALID_TOKEN_MINT_METADATA=248 The requested token mint metadata was invalid + * @property {number} INVALID_TOKEN_BURN_METADATA=249 The requested token burn metadata was invalid + * @property {number} CURRENT_TREASURY_STILL_OWNS_NFTS=250 The treasury for a unique token cannot be changed until it owns no NFTs + * @property {number} ACCOUNT_STILL_OWNS_NFTS=251 An account cannot be dissociated from a unique token if it owns NFTs for the token + * @property {number} TREASURY_MUST_OWN_BURNED_NFT=252 A NFT can only be burned when owned by the unique token's treasury + * @property {number} ACCOUNT_DOES_NOT_OWN_WIPED_NFT=253 An account did not own the NFT to be wiped + * @property {number} ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON=254 An AccountAmount token transfers list referenced a token type other than FUNGIBLE_COMMON + * @property {number} MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED=255 All the NFTs allowed in the current price regime have already been minted + * @property {number} PAYER_ACCOUNT_DELETED=256 The payer account has been marked as deleted + * @property {number} CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH=257 The reference chain of custom fees for a transferred token exceeded the maximum length of 2 + * @property {number} CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS=258 More than 20 balance adjustments were to satisfy a CryptoTransfer and its implied custom fee payments + * @property {number} INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE=259 The sender account in the token transfer transaction could not afford a custom fee + * @property {number} SERIAL_NUMBER_LIMIT_REACHED=260 Currently no more than 4,294,967,295 NFTs may be minted for a given unique token type + * @property {number} CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE=261 Only tokens of type NON_FUNGIBLE_UNIQUE can have royalty fees + * @property {number} NO_REMAINING_AUTOMATIC_ASSOCIATIONS=262 The account has reached the limit on the automatic associations count. + * @property {number} EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT=263 Already existing automatic associations are more than the new maximum automatic associations. + * @property {number} REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT=264 Cannot set the number of automatic associations for an account more than the maximum allowed + * token associations tokens.maxPerAccount. + * @property {number} TOKEN_IS_PAUSED=265 Token is paused. This Token cannot be a part of any kind of Transaction until unpaused. + * @property {number} TOKEN_HAS_NO_PAUSE_KEY=266 Pause key is not set on token + * @property {number} INVALID_PAUSE_KEY=267 The provided pause key was invalid + * @property {number} FREEZE_UPDATE_FILE_DOES_NOT_EXIST=268 The update file in a freeze transaction body must exist. + * @property {number} FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH=269 The hash of the update file in a freeze transaction body must match the in-memory hash. + * @property {number} NO_UPGRADE_HAS_BEEN_PREPARED=270 A FREEZE_UPGRADE transaction was handled with no previous update prepared. + * @property {number} NO_FREEZE_IS_SCHEDULED=271 A FREEZE_ABORT transaction was handled with no scheduled freeze. + * @property {number} UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE=272 The update file hash when handling a FREEZE_UPGRADE transaction differs from the file + * hash at the time of handling the PREPARE_UPGRADE transaction. + * @property {number} FREEZE_START_TIME_MUST_BE_FUTURE=273 The given freeze start time was in the (consensus) past. + * @property {number} PREPARED_UPDATE_FILE_IS_IMMUTABLE=274 The prepared update file cannot be updated or appended until either the upgrade has + * been completed, or a FREEZE_ABORT has been handled. + * @property {number} FREEZE_ALREADY_SCHEDULED=275 Once a freeze is scheduled, it must be aborted before any other type of freeze can + * can be performed. + * @property {number} FREEZE_UPGRADE_IN_PROGRESS=276 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.) + * @property {number} UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED=277 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. + * @property {number} UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED=278 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. + * @property {number} CONSENSUS_GAS_EXHAUSTED=279 Consensus throttle did not allow execution of this transaction. System is throttled at + * consensus level. + * @property {number} REVERTED_SUCCESS=280 A precompiled contract succeeded, but was later reverted. + * @property {number} MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED=281 All contract storage allocated to the current price regime has been consumed. + * @property {number} INVALID_ALIAS_KEY=282 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. + * @property {number} UNEXPECTED_TOKEN_DECIMALS=283 A fungible token transfer expected a different number of decimals than the involved + * type actually has. + * @property {number} INVALID_PROXY_ACCOUNT_ID=284 The proxy account id is invalid or does not exist. + * @property {number} INVALID_TRANSFER_ACCOUNT_ID=285 The transfer account id in CryptoDelete transaction is invalid or does not exist. + * @property {number} INVALID_FEE_COLLECTOR_ACCOUNT_ID=286 The fee collector account id in TokenFeeScheduleUpdate is invalid or does not exist. + * @property {number} ALIAS_IS_IMMUTABLE=287 The alias already set on an account cannot be updated using CryptoUpdate transaction. + * @property {number} SPENDER_ACCOUNT_SAME_AS_OWNER=288 An approved allowance specifies a spender account that is the same as the hbar/token + * owner account. + * @property {number} AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY=289 The establishment or adjustment of an approved allowance cause the token allowance + * to exceed the token maximum supply. + * @property {number} NEGATIVE_ALLOWANCE_AMOUNT=290 The specified amount for an approved allowance cannot be negative. + * @property {number} CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON=291 The approveForAll flag cannot be set for a fungible token. + * @property {number} SPENDER_DOES_NOT_HAVE_ALLOWANCE=292 The spender does not have an existing approved allowance with the hbar/token owner. + * @property {number} AMOUNT_EXCEEDS_ALLOWANCE=293 The transfer amount exceeds the current approved allowance for the spender account. + * @property {number} MAX_ALLOWANCES_EXCEEDED=294 The payer account of an approveAllowances or adjustAllowance transaction is attempting + * to go beyond the maximum allowed number of allowances. + * @property {number} EMPTY_ALLOWANCES=295 No allowances have been specified in the approval transaction. + * @property {number} SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES=296 Spender is repeated more than once in Crypto or Token or NFT allowance lists in a single + * CryptoApproveAllowance transaction. + * @property {number} REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES=297 Serial numbers are repeated in nft allowance for a single spender account + * @property {number} FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES=298 Fungible common token used in NFT allowances + * @property {number} NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES=299 Non fungible token used in fungible token allowances + * @property {number} INVALID_ALLOWANCE_OWNER_ID=300 The account id specified as the owner is invalid or does not exist. + * @property {number} INVALID_ALLOWANCE_SPENDER_ID=301 The account id specified as the spender is invalid or does not exist. + * @property {number} REPEATED_ALLOWANCES_TO_DELETE=302 [Deprecated] If the CryptoDeleteAllowance transaction has repeated crypto or token or Nft allowances to delete. + * @property {number} INVALID_DELEGATING_SPENDER=303 If the account Id specified as the delegating spender is invalid or does not exist. + * @property {number} DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL=304 The delegating Spender cannot grant approveForAll allowance on a NFT token type for another spender. + * @property {number} DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL=305 The delegating Spender cannot grant allowance on a NFT serial for another spender as it doesnt not have approveForAll + * granted on token-owner. + * @property {number} SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE=306 The scheduled transaction could not be created because it's expiration_time was too far in the future. + * @property {number} SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME=307 The scheduled transaction could not be created because it's expiration_time was less than or equal to the consensus time. + * @property {number} SCHEDULE_FUTURE_THROTTLE_EXCEEDED=308 The scheduled transaction could not be created because it would cause throttles to be violated on the specified expiration_time. + * @property {number} SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED=309 The scheduled transaction could not be created because it would cause the gas limit to be violated on the specified expiration_time. + * @property {number} INVALID_ETHEREUM_TRANSACTION=310 The ethereum transaction either failed parsing or failed signature validation, or some other EthereumTransaction error not covered by another response code. + * @property {number} WRONG_CHAIN_ID=311 EthereumTransaction was signed against a chainId that this network does not support. + * @property {number} WRONG_NONCE=312 This transaction specified an ethereumNonce that is not the current ethereumNonce of the account. + * @property {number} ACCESS_LIST_UNSUPPORTED=313 The ethereum transaction specified an access list, which the network does not support. + * @property {number} SCHEDULE_PENDING_EXPIRATION=314 A schedule being signed or deleted has passed it's expiration date and is pending execution if needed and then expiration. + * @property {number} CONTRACT_IS_TOKEN_TREASURY=315 A selfdestruct or ContractDelete targeted a contract that is a token treasury. + * @property {number} CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES=316 A selfdestruct or ContractDelete targeted a contract with non-zero token balances. + * @property {number} CONTRACT_EXPIRED_AND_PENDING_REMOVAL=317 A contract referenced by a transaction is "detached"; that is, expired and lacking any + * hbar funds for auto-renewal payment---but still within its post-expiry grace period. + * @property {number} CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT=318 A ContractUpdate requested removal of a contract's auto-renew account, but that contract has + * no auto-renew account. + * @property {number} PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION=319 A delete transaction submitted via HAPI set permanent_removal=true + * @property {number} PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED=320 PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED value + * @property {number} SELF_STAKING_IS_NOT_ALLOWED=321 An account set the staked_account_id to itself in CryptoUpdate or ContractUpdate transactions. + * @property {number} INVALID_STAKING_ID=322 The staking account id or staking node id given is invalid or does not exist. + * @property {number} STAKING_NOT_ENABLED=323 Native staking, while implemented, has not yet enabled by the council. + * @property {number} INVALID_PRNG_RANGE=324 The range provided in UtilPrng transaction is negative. + * @property {number} MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED=325 The maximum number of entities allowed in the current price regime have been created. + * @property {number} INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE=326 The full prefix signature for precompile is not valid + * @property {number} INSUFFICIENT_BALANCES_FOR_STORAGE_RENT=327 The combined balances of a contract and its auto-renew account (if any) did not cover + * the rent charged for net new storage used in a transaction. + * @property {number} MAX_CHILD_RECORDS_EXCEEDED=328 A contract transaction tried to use more than the allowed number of child records, via + * either system contract records or internal contract creations. + * @property {number} INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES=329 The combined balances of a contract and its auto-renew account (if any) or balance of an account did not cover + * the auto-renewal fees in a transaction. + * @property {number} TRANSACTION_HAS_UNKNOWN_FIELDS=330 A transaction's protobuf message includes unknown fields; could mean that a client + * expects not-yet-released functionality to be available. + * @property {number} ACCOUNT_IS_IMMUTABLE=331 The account cannot be modified. Account's key is not set + * @property {number} ALIAS_ALREADY_ASSIGNED=332 An alias that is assigned to an account or contract cannot be assigned to another account or contract. + * @property {number} INVALID_METADATA_KEY=333 A provided metadata key was invalid. Verification includes, for example, checking the size of Ed25519 and ECDSA(secp256k1) public keys. + * @property {number} TOKEN_HAS_NO_METADATA_KEY=334 Metadata key is not set on token + * @property {number} MISSING_TOKEN_METADATA=335 Token Metadata is not provided + * @property {number} MISSING_SERIAL_NUMBERS=336 NFT serial numbers are missing in the TokenUpdateNftsTransactionBody + * @property {number} TOKEN_HAS_NO_ADMIN_KEY=337 Admin key is not set on token + * @property {number} NODE_DELETED=338 A transaction failed because the consensus node identified is + * deleted from the address book. + * @property {number} INVALID_NODE_ID=339 A transaction failed because the consensus node identified is not valid or + * does not exist in state. + * @property {number} INVALID_GOSSIP_ENDPOINT=340 A transaction failed because one or more entries in the list of + * service endpoints for the `gossip_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + * @property {number} INVALID_NODE_ACCOUNT_ID=341 A transaction failed because the node account identifier provided + * does not exist or is not valid.
+ * One common source of this error is providing a node account identifier + * using the "alias" form rather than "numeric" form. + * It is also used for atomic batch transaction for child transaction if the node account id is not 0.0.0. + * @property {number} INVALID_NODE_DESCRIPTION=342 A transaction failed because the description field cannot be encoded + * as UTF-8 or is more than 100 bytes when encoded. + * @property {number} INVALID_SERVICE_ENDPOINT=343 A transaction failed because one or more entries in the list of + * service endpoints for the `service_endpoint` field is invalid.
+ * The most common cause for this response is a service endpoint that has + * the domain name (DNS) set rather than address and port. + * @property {number} INVALID_GOSSIP_CA_CERTIFICATE=344 A transaction failed because the TLS certificate provided for the + * node is missing or invalid. + *

+ * #### Probable Causes + * The certificate MUST be a TLS certificate of a type permitted for gossip + * signatures.
+ * The value presented MUST be a UTF-8 NFKD encoding of the TLS + * certificate.
+ * The certificate encoded MUST be in PEM format.
+ * The `gossip_ca_certificate` field is REQUIRED and MUST NOT be empty. + * @property {number} INVALID_GRPC_CERTIFICATE=345 A transaction failed because the hash provided for the gRPC certificate + * is present but invalid. + *

+ * #### Probable Causes + * The `grpc_certificate_hash` MUST be a SHA-384 hash.
+ * The input hashed MUST be a UTF-8 NFKD encoding of the actual TLS + * certificate.
+ * The certificate to be encoded MUST be in PEM format. + * @property {number} INVALID_MAX_AUTO_ASSOCIATIONS=346 The maximum automatic associations value is not valid.
+ * The most common cause for this error is a value less than `-1`. + * @property {number} MAX_NODES_CREATED=347 The maximum number of nodes allowed in the address book have been created. + * @property {number} IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT=348 In ServiceEndpoint, domain_name and ipAddressV4 are mutually exclusive + * @property {number} GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN=349 Fully qualified domain name is not allowed in gossip_endpoint + * @property {number} FQDN_SIZE_TOO_LARGE=350 In ServiceEndpoint, domain_name size too large + * @property {number} INVALID_ENDPOINT=351 ServiceEndpoint is invalid + * @property {number} GOSSIP_ENDPOINTS_EXCEEDED_LIMIT=352 The number of gossip endpoints exceeds the limit + * @property {number} TOKEN_REFERENCE_REPEATED=353 The transaction attempted to use duplicate `TokenReference`.
+ * This affects `TokenReject` attempting to reject same token reference more than once. + * @property {number} INVALID_OWNER_ID=354 The account id specified as the owner in `TokenReject` is invalid or does not exist. + * @property {number} TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED=355 The transaction attempted to use more than the allowed number of `TokenReference`. + * @property {number} SERVICE_ENDPOINTS_EXCEEDED_LIMIT=356 The number of service endpoints exceeds the limit + * @property {number} INVALID_IPV4_ADDRESS=357 INVALID_IPV4_ADDRESS value + * @property {number} EMPTY_TOKEN_REFERENCE_LIST=358 The transaction attempted to use empty `TokenReference` list. + * @property {number} UPDATE_NODE_ACCOUNT_NOT_ALLOWED=359 UPDATE_NODE_ACCOUNT_NOT_ALLOWED value + * @property {number} TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY=360 TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY value + * @property {number} EMPTY_PENDING_AIRDROP_ID_LIST=361 The list of `PendingAirdropId`s is empty and MUST NOT be empty. + * @property {number} PENDING_AIRDROP_ID_REPEATED=362 A `PendingAirdropId` is repeated in a `claim` or `cancel` transaction. + * @property {number} PENDING_AIRDROP_ID_LIST_TOO_LONG=363 The number of `PendingAirdropId` values in the list exceeds the maximum + * allowable number. + * @property {number} PENDING_NFT_AIRDROP_ALREADY_EXISTS=364 PENDING_NFT_AIRDROP_ALREADY_EXISTS value + * @property {number} ACCOUNT_HAS_PENDING_AIRDROPS=365 ACCOUNT_HAS_PENDING_AIRDROPS value + * @property {number} THROTTLED_AT_CONSENSUS=366 Consensus throttle did not allow execution of this transaction.
+ * The transaction should be retried after a modest delay. + * @property {number} INVALID_PENDING_AIRDROP_ID=367 The provided pending airdrop id is invalid.
+ * This pending airdrop MAY already be claimed or cancelled. + *

+ * The client SHOULD query a mirror node to determine the current status of + * the pending airdrop. + * @property {number} TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY=368 The token to be airdropped has a fallback royalty fee and cannot be + * sent or claimed via an airdrop transaction. + * @property {number} INVALID_TOKEN_IN_PENDING_AIRDROP=369 This airdrop claim is for a pending airdrop with an invalid token.
+ * The token might be deleted, or the sender may not have enough tokens + * to fulfill the offer. + *

+ * The client SHOULD query mirror node to determine the status of the + * pending airdrop and whether the sender can fulfill the offer. + * @property {number} SCHEDULE_EXPIRY_IS_BUSY=370 A scheduled transaction configured to wait for expiry to execute was given + * an expiry time at which there is already too many transactions scheduled to + * expire; its creation must be retried with a different expiry. + * @property {number} INVALID_GRPC_CERTIFICATE_HASH=371 The provided gRPC certificate hash is invalid. + * @property {number} MISSING_EXPIRY_TIME=372 A scheduled transaction configured to wait for expiry to execute was not + * given an explicit expiration time. + * @property {number} NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION=373 A contract operation attempted to schedule another transaction after it + * had already scheduled a recursive contract call. + * @property {number} RECURSIVE_SCHEDULING_LIMIT_REACHED=374 A contract can schedule recursive calls a finite number of times (this is + * approximately four million times with typical network configuration.) + * @property {number} WAITING_FOR_LEDGER_ID=375 The target network is waiting for the ledger ID to be set, which is a + * side effect of finishing the network's TSS construction. + * @property {number} MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED=376 The provided fee exempt key list size exceeded the limit. + * @property {number} FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS=377 The provided fee exempt key list contains duplicated keys. + * @property {number} INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST=378 The provided fee exempt key list contains an invalid key. + * @property {number} INVALID_FEE_SCHEDULE_KEY=379 The provided fee schedule key contains an invalid key. + * @property {number} FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED=380 If a fee schedule key is not set when we create a topic + * we cannot add it on update. + * @property {number} FEE_SCHEDULE_KEY_NOT_SET=381 If the topic's custom fees are updated the topic SHOULD have a + * fee schedule key + * @property {number} MAX_CUSTOM_FEE_LIMIT_EXCEEDED=382 The fee amount is exceeding the amount that the payer + * is willing to pay. + * @property {number} NO_VALID_MAX_CUSTOM_FEE=383 There are no corresponding custom fees. + * @property {number} INVALID_MAX_CUSTOM_FEES=384 The provided list contains invalid max custom fee. + * @property {number} DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST=385 The provided max custom fee list contains fees with + * duplicate denominations. + * @property {number} DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST=386 The provided max custom fee list contains fees with + * duplicate account id. + * @property {number} MAX_CUSTOM_FEES_IS_NOT_SUPPORTED=387 Max custom fees list is not supported for this operation. + * @property {number} BATCH_LIST_EMPTY=388 The list of batch transactions is empty + * @property {number} BATCH_LIST_CONTAINS_DUPLICATES=389 The list of batch transactions contains duplicated transactions + * @property {number} BATCH_TRANSACTION_IN_BLACKLIST=390 The list of batch transactions contains a transaction type that is + * in the AtomicBatch blacklist as configured in the network. + * @property {number} INNER_TRANSACTION_FAILED=391 The inner transaction of a batch transaction failed + * @property {number} MISSING_BATCH_KEY=392 The inner transaction of a batch transaction is missing a batch key + * @property {number} BATCH_KEY_SET_ON_NON_INNER_TRANSACTION=393 The batch key is set for a non batch transaction + * @property {number} INVALID_BATCH_KEY=394 The batch key is not valid + * @property {number} SCHEDULE_EXPIRY_NOT_CONFIGURABLE=395 The provided schedule expiry time is not configurable. + * @property {number} CREATING_SYSTEM_ENTITIES=396 The network just started at genesis and is creating system entities. + * @property {number} THROTTLE_GROUP_LCM_OVERFLOW=397 The least common multiple of the throttle group's milliOpsPerSec is + * too large and it's overflowing. + * @property {number} AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN=398 Token airdrop transactions can not contain multiple senders for a single token. + * @property {number} GRPC_WEB_PROXY_NOT_SUPPORTED=399 The GRPC proxy endpoint is set in the NodeCreate or NodeUpdate transaction, + * which the network does not support. + * @property {number} NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE=400 An NFT transfers list referenced a token type other than NON_FUNGIBLE_UNIQUE. + */ + proto.ResponseCodeEnum = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OK"] = 0; + values[valuesById[1] = "INVALID_TRANSACTION"] = 1; + values[valuesById[2] = "PAYER_ACCOUNT_NOT_FOUND"] = 2; + values[valuesById[3] = "INVALID_NODE_ACCOUNT"] = 3; + values[valuesById[4] = "TRANSACTION_EXPIRED"] = 4; + values[valuesById[5] = "INVALID_TRANSACTION_START"] = 5; + values[valuesById[6] = "INVALID_TRANSACTION_DURATION"] = 6; + values[valuesById[7] = "INVALID_SIGNATURE"] = 7; + values[valuesById[8] = "MEMO_TOO_LONG"] = 8; + values[valuesById[9] = "INSUFFICIENT_TX_FEE"] = 9; + values[valuesById[10] = "INSUFFICIENT_PAYER_BALANCE"] = 10; + values[valuesById[11] = "DUPLICATE_TRANSACTION"] = 11; + values[valuesById[12] = "BUSY"] = 12; + values[valuesById[13] = "NOT_SUPPORTED"] = 13; + values[valuesById[14] = "INVALID_FILE_ID"] = 14; + values[valuesById[15] = "INVALID_ACCOUNT_ID"] = 15; + values[valuesById[16] = "INVALID_CONTRACT_ID"] = 16; + values[valuesById[17] = "INVALID_TRANSACTION_ID"] = 17; + values[valuesById[18] = "RECEIPT_NOT_FOUND"] = 18; + values[valuesById[19] = "RECORD_NOT_FOUND"] = 19; + values[valuesById[20] = "INVALID_SOLIDITY_ID"] = 20; + values[valuesById[21] = "UNKNOWN"] = 21; + values[valuesById[22] = "SUCCESS"] = 22; + values[valuesById[23] = "FAIL_INVALID"] = 23; + values[valuesById[24] = "FAIL_FEE"] = 24; + values[valuesById[25] = "FAIL_BALANCE"] = 25; + values[valuesById[26] = "KEY_REQUIRED"] = 26; + values[valuesById[27] = "BAD_ENCODING"] = 27; + values[valuesById[28] = "INSUFFICIENT_ACCOUNT_BALANCE"] = 28; + values[valuesById[29] = "INVALID_SOLIDITY_ADDRESS"] = 29; + values[valuesById[30] = "INSUFFICIENT_GAS"] = 30; + values[valuesById[31] = "CONTRACT_SIZE_LIMIT_EXCEEDED"] = 31; + values[valuesById[32] = "LOCAL_CALL_MODIFICATION_EXCEPTION"] = 32; + values[valuesById[33] = "CONTRACT_REVERT_EXECUTED"] = 33; + values[valuesById[34] = "CONTRACT_EXECUTION_EXCEPTION"] = 34; + values[valuesById[35] = "INVALID_RECEIVING_NODE_ACCOUNT"] = 35; + values[valuesById[36] = "MISSING_QUERY_HEADER"] = 36; + values[valuesById[37] = "ACCOUNT_UPDATE_FAILED"] = 37; + values[valuesById[38] = "INVALID_KEY_ENCODING"] = 38; + values[valuesById[39] = "NULL_SOLIDITY_ADDRESS"] = 39; + values[valuesById[40] = "CONTRACT_UPDATE_FAILED"] = 40; + values[valuesById[41] = "INVALID_QUERY_HEADER"] = 41; + values[valuesById[42] = "INVALID_FEE_SUBMITTED"] = 42; + values[valuesById[43] = "INVALID_PAYER_SIGNATURE"] = 43; + values[valuesById[44] = "KEY_NOT_PROVIDED"] = 44; + values[valuesById[45] = "INVALID_EXPIRATION_TIME"] = 45; + values[valuesById[46] = "NO_WACL_KEY"] = 46; + values[valuesById[47] = "FILE_CONTENT_EMPTY"] = 47; + values[valuesById[48] = "INVALID_ACCOUNT_AMOUNTS"] = 48; + values[valuesById[49] = "EMPTY_TRANSACTION_BODY"] = 49; + values[valuesById[50] = "INVALID_TRANSACTION_BODY"] = 50; + values[valuesById[51] = "INVALID_SIGNATURE_TYPE_MISMATCHING_KEY"] = 51; + values[valuesById[52] = "INVALID_SIGNATURE_COUNT_MISMATCHING_KEY"] = 52; + values[valuesById[53] = "EMPTY_LIVE_HASH_BODY"] = 53; + values[valuesById[54] = "EMPTY_LIVE_HASH"] = 54; + values[valuesById[55] = "EMPTY_LIVE_HASH_KEYS"] = 55; + values[valuesById[56] = "INVALID_LIVE_HASH_SIZE"] = 56; + values[valuesById[57] = "EMPTY_QUERY_BODY"] = 57; + values[valuesById[58] = "EMPTY_LIVE_HASH_QUERY"] = 58; + values[valuesById[59] = "LIVE_HASH_NOT_FOUND"] = 59; + values[valuesById[60] = "ACCOUNT_ID_DOES_NOT_EXIST"] = 60; + values[valuesById[61] = "LIVE_HASH_ALREADY_EXISTS"] = 61; + values[valuesById[62] = "INVALID_FILE_WACL"] = 62; + values[valuesById[63] = "SERIALIZATION_FAILED"] = 63; + values[valuesById[64] = "TRANSACTION_OVERSIZE"] = 64; + values[valuesById[65] = "TRANSACTION_TOO_MANY_LAYERS"] = 65; + values[valuesById[66] = "CONTRACT_DELETED"] = 66; + values[valuesById[67] = "PLATFORM_NOT_ACTIVE"] = 67; + values[valuesById[68] = "KEY_PREFIX_MISMATCH"] = 68; + values[valuesById[69] = "PLATFORM_TRANSACTION_NOT_CREATED"] = 69; + values[valuesById[70] = "INVALID_RENEWAL_PERIOD"] = 70; + values[valuesById[71] = "INVALID_PAYER_ACCOUNT_ID"] = 71; + values[valuesById[72] = "ACCOUNT_DELETED"] = 72; + values[valuesById[73] = "FILE_DELETED"] = 73; + values[valuesById[74] = "ACCOUNT_REPEATED_IN_ACCOUNT_AMOUNTS"] = 74; + values[valuesById[75] = "SETTING_NEGATIVE_ACCOUNT_BALANCE"] = 75; + values[valuesById[76] = "OBTAINER_REQUIRED"] = 76; + values[valuesById[77] = "OBTAINER_SAME_CONTRACT_ID"] = 77; + values[valuesById[78] = "OBTAINER_DOES_NOT_EXIST"] = 78; + values[valuesById[79] = "MODIFYING_IMMUTABLE_CONTRACT"] = 79; + values[valuesById[80] = "FILE_SYSTEM_EXCEPTION"] = 80; + values[valuesById[81] = "AUTORENEW_DURATION_NOT_IN_RANGE"] = 81; + values[valuesById[82] = "ERROR_DECODING_BYTESTRING"] = 82; + values[valuesById[83] = "CONTRACT_FILE_EMPTY"] = 83; + values[valuesById[84] = "CONTRACT_BYTECODE_EMPTY"] = 84; + values[valuesById[85] = "INVALID_INITIAL_BALANCE"] = 85; + values[valuesById[86] = "INVALID_RECEIVE_RECORD_THRESHOLD"] = 86; + values[valuesById[87] = "INVALID_SEND_RECORD_THRESHOLD"] = 87; + values[valuesById[88] = "ACCOUNT_IS_NOT_GENESIS_ACCOUNT"] = 88; + values[valuesById[89] = "PAYER_ACCOUNT_UNAUTHORIZED"] = 89; + values[valuesById[90] = "INVALID_FREEZE_TRANSACTION_BODY"] = 90; + values[valuesById[91] = "FREEZE_TRANSACTION_BODY_NOT_FOUND"] = 91; + values[valuesById[92] = "TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"] = 92; + values[valuesById[93] = "RESULT_SIZE_LIMIT_EXCEEDED"] = 93; + values[valuesById[94] = "NOT_SPECIAL_ACCOUNT"] = 94; + values[valuesById[95] = "CONTRACT_NEGATIVE_GAS"] = 95; + values[valuesById[96] = "CONTRACT_NEGATIVE_VALUE"] = 96; + values[valuesById[97] = "INVALID_FEE_FILE"] = 97; + values[valuesById[98] = "INVALID_EXCHANGE_RATE_FILE"] = 98; + values[valuesById[99] = "INSUFFICIENT_LOCAL_CALL_GAS"] = 99; + values[valuesById[100] = "ENTITY_NOT_ALLOWED_TO_DELETE"] = 100; + values[valuesById[101] = "AUTHORIZATION_FAILED"] = 101; + values[valuesById[102] = "FILE_UPLOADED_PROTO_INVALID"] = 102; + values[valuesById[103] = "FILE_UPLOADED_PROTO_NOT_SAVED_TO_DISK"] = 103; + values[valuesById[104] = "FEE_SCHEDULE_FILE_PART_UPLOADED"] = 104; + values[valuesById[105] = "EXCHANGE_RATE_CHANGE_LIMIT_EXCEEDED"] = 105; + values[valuesById[106] = "MAX_CONTRACT_STORAGE_EXCEEDED"] = 106; + values[valuesById[107] = "TRANSFER_ACCOUNT_SAME_AS_DELETE_ACCOUNT"] = 107; + values[valuesById[108] = "TOTAL_LEDGER_BALANCE_INVALID"] = 108; + values[valuesById[110] = "EXPIRATION_REDUCTION_NOT_ALLOWED"] = 110; + values[valuesById[111] = "MAX_GAS_LIMIT_EXCEEDED"] = 111; + values[valuesById[112] = "MAX_FILE_SIZE_EXCEEDED"] = 112; + values[valuesById[113] = "RECEIVER_SIG_REQUIRED"] = 113; + values[valuesById[150] = "INVALID_TOPIC_ID"] = 150; + values[valuesById[155] = "INVALID_ADMIN_KEY"] = 155; + values[valuesById[156] = "INVALID_SUBMIT_KEY"] = 156; + values[valuesById[157] = "UNAUTHORIZED"] = 157; + values[valuesById[158] = "INVALID_TOPIC_MESSAGE"] = 158; + values[valuesById[159] = "INVALID_AUTORENEW_ACCOUNT"] = 159; + values[valuesById[160] = "AUTORENEW_ACCOUNT_NOT_ALLOWED"] = 160; + values[valuesById[162] = "TOPIC_EXPIRED"] = 162; + values[valuesById[163] = "INVALID_CHUNK_NUMBER"] = 163; + values[valuesById[164] = "INVALID_CHUNK_TRANSACTION_ID"] = 164; + values[valuesById[165] = "ACCOUNT_FROZEN_FOR_TOKEN"] = 165; + values[valuesById[166] = "TOKENS_PER_ACCOUNT_LIMIT_EXCEEDED"] = 166; + values[valuesById[167] = "INVALID_TOKEN_ID"] = 167; + values[valuesById[168] = "INVALID_TOKEN_DECIMALS"] = 168; + values[valuesById[169] = "INVALID_TOKEN_INITIAL_SUPPLY"] = 169; + values[valuesById[170] = "INVALID_TREASURY_ACCOUNT_FOR_TOKEN"] = 170; + values[valuesById[171] = "INVALID_TOKEN_SYMBOL"] = 171; + values[valuesById[172] = "TOKEN_HAS_NO_FREEZE_KEY"] = 172; + values[valuesById[173] = "TRANSFERS_NOT_ZERO_SUM_FOR_TOKEN"] = 173; + values[valuesById[174] = "MISSING_TOKEN_SYMBOL"] = 174; + values[valuesById[175] = "TOKEN_SYMBOL_TOO_LONG"] = 175; + values[valuesById[176] = "ACCOUNT_KYC_NOT_GRANTED_FOR_TOKEN"] = 176; + values[valuesById[177] = "TOKEN_HAS_NO_KYC_KEY"] = 177; + values[valuesById[178] = "INSUFFICIENT_TOKEN_BALANCE"] = 178; + values[valuesById[179] = "TOKEN_WAS_DELETED"] = 179; + values[valuesById[180] = "TOKEN_HAS_NO_SUPPLY_KEY"] = 180; + values[valuesById[181] = "TOKEN_HAS_NO_WIPE_KEY"] = 181; + values[valuesById[182] = "INVALID_TOKEN_MINT_AMOUNT"] = 182; + values[valuesById[183] = "INVALID_TOKEN_BURN_AMOUNT"] = 183; + values[valuesById[184] = "TOKEN_NOT_ASSOCIATED_TO_ACCOUNT"] = 184; + values[valuesById[185] = "CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT"] = 185; + values[valuesById[186] = "INVALID_KYC_KEY"] = 186; + values[valuesById[187] = "INVALID_WIPE_KEY"] = 187; + values[valuesById[188] = "INVALID_FREEZE_KEY"] = 188; + values[valuesById[189] = "INVALID_SUPPLY_KEY"] = 189; + values[valuesById[190] = "MISSING_TOKEN_NAME"] = 190; + values[valuesById[191] = "TOKEN_NAME_TOO_LONG"] = 191; + values[valuesById[192] = "INVALID_WIPING_AMOUNT"] = 192; + values[valuesById[193] = "TOKEN_IS_IMMUTABLE"] = 193; + values[valuesById[194] = "TOKEN_ALREADY_ASSOCIATED_TO_ACCOUNT"] = 194; + values[valuesById[195] = "TRANSACTION_REQUIRES_ZERO_TOKEN_BALANCES"] = 195; + values[valuesById[196] = "ACCOUNT_IS_TREASURY"] = 196; + values[valuesById[197] = "TOKEN_ID_REPEATED_IN_TOKEN_LIST"] = 197; + values[valuesById[198] = "TOKEN_TRANSFER_LIST_SIZE_LIMIT_EXCEEDED"] = 198; + values[valuesById[199] = "EMPTY_TOKEN_TRANSFER_BODY"] = 199; + values[valuesById[200] = "EMPTY_TOKEN_TRANSFER_ACCOUNT_AMOUNTS"] = 200; + values[valuesById[201] = "INVALID_SCHEDULE_ID"] = 201; + values[valuesById[202] = "SCHEDULE_IS_IMMUTABLE"] = 202; + values[valuesById[203] = "INVALID_SCHEDULE_PAYER_ID"] = 203; + values[valuesById[204] = "INVALID_SCHEDULE_ACCOUNT_ID"] = 204; + values[valuesById[205] = "NO_NEW_VALID_SIGNATURES"] = 205; + values[valuesById[206] = "UNRESOLVABLE_REQUIRED_SIGNERS"] = 206; + values[valuesById[207] = "SCHEDULED_TRANSACTION_NOT_IN_WHITELIST"] = 207; + values[valuesById[208] = "SOME_SIGNATURES_WERE_INVALID"] = 208; + values[valuesById[209] = "TRANSACTION_ID_FIELD_NOT_ALLOWED"] = 209; + values[valuesById[210] = "IDENTICAL_SCHEDULE_ALREADY_CREATED"] = 210; + values[valuesById[211] = "INVALID_ZERO_BYTE_IN_STRING"] = 211; + values[valuesById[212] = "SCHEDULE_ALREADY_DELETED"] = 212; + values[valuesById[213] = "SCHEDULE_ALREADY_EXECUTED"] = 213; + values[valuesById[214] = "MESSAGE_SIZE_TOO_LARGE"] = 214; + values[valuesById[215] = "OPERATION_REPEATED_IN_BUCKET_GROUPS"] = 215; + values[valuesById[216] = "BUCKET_CAPACITY_OVERFLOW"] = 216; + values[valuesById[217] = "NODE_CAPACITY_NOT_SUFFICIENT_FOR_OPERATION"] = 217; + values[valuesById[218] = "BUCKET_HAS_NO_THROTTLE_GROUPS"] = 218; + values[valuesById[219] = "THROTTLE_GROUP_HAS_ZERO_OPS_PER_SEC"] = 219; + values[valuesById[220] = "SUCCESS_BUT_MISSING_EXPECTED_OPERATION"] = 220; + values[valuesById[221] = "UNPARSEABLE_THROTTLE_DEFINITIONS"] = 221; + values[valuesById[222] = "INVALID_THROTTLE_DEFINITIONS"] = 222; + values[valuesById[223] = "ACCOUNT_EXPIRED_AND_PENDING_REMOVAL"] = 223; + values[valuesById[224] = "INVALID_TOKEN_MAX_SUPPLY"] = 224; + values[valuesById[225] = "INVALID_TOKEN_NFT_SERIAL_NUMBER"] = 225; + values[valuesById[226] = "INVALID_NFT_ID"] = 226; + values[valuesById[227] = "METADATA_TOO_LONG"] = 227; + values[valuesById[228] = "BATCH_SIZE_LIMIT_EXCEEDED"] = 228; + values[valuesById[229] = "INVALID_QUERY_RANGE"] = 229; + values[valuesById[230] = "FRACTION_DIVIDES_BY_ZERO"] = 230; + values[valuesById[231] = "INSUFFICIENT_PAYER_BALANCE_FOR_CUSTOM_FEE"] = 231; + values[valuesById[232] = "CUSTOM_FEES_LIST_TOO_LONG"] = 232; + values[valuesById[233] = "INVALID_CUSTOM_FEE_COLLECTOR"] = 233; + values[valuesById[234] = "INVALID_TOKEN_ID_IN_CUSTOM_FEES"] = 234; + values[valuesById[235] = "TOKEN_NOT_ASSOCIATED_TO_FEE_COLLECTOR"] = 235; + values[valuesById[236] = "TOKEN_MAX_SUPPLY_REACHED"] = 236; + values[valuesById[237] = "SENDER_DOES_NOT_OWN_NFT_SERIAL_NO"] = 237; + values[valuesById[238] = "CUSTOM_FEE_NOT_FULLY_SPECIFIED"] = 238; + values[valuesById[239] = "CUSTOM_FEE_MUST_BE_POSITIVE"] = 239; + values[valuesById[240] = "TOKEN_HAS_NO_FEE_SCHEDULE_KEY"] = 240; + values[valuesById[241] = "CUSTOM_FEE_OUTSIDE_NUMERIC_RANGE"] = 241; + values[valuesById[242] = "ROYALTY_FRACTION_CANNOT_EXCEED_ONE"] = 242; + values[valuesById[243] = "FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT"] = 243; + values[valuesById[244] = "CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES"] = 244; + values[valuesById[245] = "CUSTOM_FEE_DENOMINATION_MUST_BE_FUNGIBLE_COMMON"] = 245; + values[valuesById[246] = "CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"] = 246; + values[valuesById[247] = "INVALID_CUSTOM_FEE_SCHEDULE_KEY"] = 247; + values[valuesById[248] = "INVALID_TOKEN_MINT_METADATA"] = 248; + values[valuesById[249] = "INVALID_TOKEN_BURN_METADATA"] = 249; + values[valuesById[250] = "CURRENT_TREASURY_STILL_OWNS_NFTS"] = 250; + values[valuesById[251] = "ACCOUNT_STILL_OWNS_NFTS"] = 251; + values[valuesById[252] = "TREASURY_MUST_OWN_BURNED_NFT"] = 252; + values[valuesById[253] = "ACCOUNT_DOES_NOT_OWN_WIPED_NFT"] = 253; + values[valuesById[254] = "ACCOUNT_AMOUNT_TRANSFERS_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON"] = 254; + values[valuesById[255] = "MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED"] = 255; + values[valuesById[256] = "PAYER_ACCOUNT_DELETED"] = 256; + values[valuesById[257] = "CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH"] = 257; + values[valuesById[258] = "CUSTOM_FEE_CHARGING_EXCEEDED_MAX_ACCOUNT_AMOUNTS"] = 258; + values[valuesById[259] = "INSUFFICIENT_SENDER_ACCOUNT_BALANCE_FOR_CUSTOM_FEE"] = 259; + values[valuesById[260] = "SERIAL_NUMBER_LIMIT_REACHED"] = 260; + values[valuesById[261] = "CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE"] = 261; + values[valuesById[262] = "NO_REMAINING_AUTOMATIC_ASSOCIATIONS"] = 262; + values[valuesById[263] = "EXISTING_AUTOMATIC_ASSOCIATIONS_EXCEED_GIVEN_LIMIT"] = 263; + values[valuesById[264] = "REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT"] = 264; + values[valuesById[265] = "TOKEN_IS_PAUSED"] = 265; + values[valuesById[266] = "TOKEN_HAS_NO_PAUSE_KEY"] = 266; + values[valuesById[267] = "INVALID_PAUSE_KEY"] = 267; + values[valuesById[268] = "FREEZE_UPDATE_FILE_DOES_NOT_EXIST"] = 268; + values[valuesById[269] = "FREEZE_UPDATE_FILE_HASH_DOES_NOT_MATCH"] = 269; + values[valuesById[270] = "NO_UPGRADE_HAS_BEEN_PREPARED"] = 270; + values[valuesById[271] = "NO_FREEZE_IS_SCHEDULED"] = 271; + values[valuesById[272] = "UPDATE_FILE_HASH_CHANGED_SINCE_PREPARE_UPGRADE"] = 272; + values[valuesById[273] = "FREEZE_START_TIME_MUST_BE_FUTURE"] = 273; + values[valuesById[274] = "PREPARED_UPDATE_FILE_IS_IMMUTABLE"] = 274; + values[valuesById[275] = "FREEZE_ALREADY_SCHEDULED"] = 275; + values[valuesById[276] = "FREEZE_UPGRADE_IN_PROGRESS"] = 276; + values[valuesById[277] = "UPDATE_FILE_ID_DOES_NOT_MATCH_PREPARED"] = 277; + values[valuesById[278] = "UPDATE_FILE_HASH_DOES_NOT_MATCH_PREPARED"] = 278; + values[valuesById[279] = "CONSENSUS_GAS_EXHAUSTED"] = 279; + values[valuesById[280] = "REVERTED_SUCCESS"] = 280; + values[valuesById[281] = "MAX_STORAGE_IN_PRICE_REGIME_HAS_BEEN_USED"] = 281; + values[valuesById[282] = "INVALID_ALIAS_KEY"] = 282; + values[valuesById[283] = "UNEXPECTED_TOKEN_DECIMALS"] = 283; + values[valuesById[284] = "INVALID_PROXY_ACCOUNT_ID"] = 284; + values[valuesById[285] = "INVALID_TRANSFER_ACCOUNT_ID"] = 285; + values[valuesById[286] = "INVALID_FEE_COLLECTOR_ACCOUNT_ID"] = 286; + values[valuesById[287] = "ALIAS_IS_IMMUTABLE"] = 287; + values[valuesById[288] = "SPENDER_ACCOUNT_SAME_AS_OWNER"] = 288; + values[valuesById[289] = "AMOUNT_EXCEEDS_TOKEN_MAX_SUPPLY"] = 289; + values[valuesById[290] = "NEGATIVE_ALLOWANCE_AMOUNT"] = 290; + values[valuesById[291] = "CANNOT_APPROVE_FOR_ALL_FUNGIBLE_COMMON"] = 291; + values[valuesById[292] = "SPENDER_DOES_NOT_HAVE_ALLOWANCE"] = 292; + values[valuesById[293] = "AMOUNT_EXCEEDS_ALLOWANCE"] = 293; + values[valuesById[294] = "MAX_ALLOWANCES_EXCEEDED"] = 294; + values[valuesById[295] = "EMPTY_ALLOWANCES"] = 295; + values[valuesById[296] = "SPENDER_ACCOUNT_REPEATED_IN_ALLOWANCES"] = 296; + values[valuesById[297] = "REPEATED_SERIAL_NUMS_IN_NFT_ALLOWANCES"] = 297; + values[valuesById[298] = "FUNGIBLE_TOKEN_IN_NFT_ALLOWANCES"] = 298; + values[valuesById[299] = "NFT_IN_FUNGIBLE_TOKEN_ALLOWANCES"] = 299; + values[valuesById[300] = "INVALID_ALLOWANCE_OWNER_ID"] = 300; + values[valuesById[301] = "INVALID_ALLOWANCE_SPENDER_ID"] = 301; + values[valuesById[302] = "REPEATED_ALLOWANCES_TO_DELETE"] = 302; + values[valuesById[303] = "INVALID_DELEGATING_SPENDER"] = 303; + values[valuesById[304] = "DELEGATING_SPENDER_CANNOT_GRANT_APPROVE_FOR_ALL"] = 304; + values[valuesById[305] = "DELEGATING_SPENDER_DOES_NOT_HAVE_APPROVE_FOR_ALL"] = 305; + values[valuesById[306] = "SCHEDULE_EXPIRATION_TIME_TOO_FAR_IN_FUTURE"] = 306; + values[valuesById[307] = "SCHEDULE_EXPIRATION_TIME_MUST_BE_HIGHER_THAN_CONSENSUS_TIME"] = 307; + values[valuesById[308] = "SCHEDULE_FUTURE_THROTTLE_EXCEEDED"] = 308; + values[valuesById[309] = "SCHEDULE_FUTURE_GAS_LIMIT_EXCEEDED"] = 309; + values[valuesById[310] = "INVALID_ETHEREUM_TRANSACTION"] = 310; + values[valuesById[311] = "WRONG_CHAIN_ID"] = 311; + values[valuesById[312] = "WRONG_NONCE"] = 312; + values[valuesById[313] = "ACCESS_LIST_UNSUPPORTED"] = 313; + values[valuesById[314] = "SCHEDULE_PENDING_EXPIRATION"] = 314; + values[valuesById[315] = "CONTRACT_IS_TOKEN_TREASURY"] = 315; + values[valuesById[316] = "CONTRACT_HAS_NON_ZERO_TOKEN_BALANCES"] = 316; + values[valuesById[317] = "CONTRACT_EXPIRED_AND_PENDING_REMOVAL"] = 317; + values[valuesById[318] = "CONTRACT_HAS_NO_AUTO_RENEW_ACCOUNT"] = 318; + values[valuesById[319] = "PERMANENT_REMOVAL_REQUIRES_SYSTEM_INITIATION"] = 319; + values[valuesById[320] = "PROXY_ACCOUNT_ID_FIELD_IS_DEPRECATED"] = 320; + values[valuesById[321] = "SELF_STAKING_IS_NOT_ALLOWED"] = 321; + values[valuesById[322] = "INVALID_STAKING_ID"] = 322; + values[valuesById[323] = "STAKING_NOT_ENABLED"] = 323; + values[valuesById[324] = "INVALID_PRNG_RANGE"] = 324; + values[valuesById[325] = "MAX_ENTITIES_IN_PRICE_REGIME_HAVE_BEEN_CREATED"] = 325; + values[valuesById[326] = "INVALID_FULL_PREFIX_SIGNATURE_FOR_PRECOMPILE"] = 326; + values[valuesById[327] = "INSUFFICIENT_BALANCES_FOR_STORAGE_RENT"] = 327; + values[valuesById[328] = "MAX_CHILD_RECORDS_EXCEEDED"] = 328; + values[valuesById[329] = "INSUFFICIENT_BALANCES_FOR_RENEWAL_FEES"] = 329; + values[valuesById[330] = "TRANSACTION_HAS_UNKNOWN_FIELDS"] = 330; + values[valuesById[331] = "ACCOUNT_IS_IMMUTABLE"] = 331; + values[valuesById[332] = "ALIAS_ALREADY_ASSIGNED"] = 332; + values[valuesById[333] = "INVALID_METADATA_KEY"] = 333; + values[valuesById[334] = "TOKEN_HAS_NO_METADATA_KEY"] = 334; + values[valuesById[335] = "MISSING_TOKEN_METADATA"] = 335; + values[valuesById[336] = "MISSING_SERIAL_NUMBERS"] = 336; + values[valuesById[337] = "TOKEN_HAS_NO_ADMIN_KEY"] = 337; + values[valuesById[338] = "NODE_DELETED"] = 338; + values[valuesById[339] = "INVALID_NODE_ID"] = 339; + values[valuesById[340] = "INVALID_GOSSIP_ENDPOINT"] = 340; + values[valuesById[341] = "INVALID_NODE_ACCOUNT_ID"] = 341; + values[valuesById[342] = "INVALID_NODE_DESCRIPTION"] = 342; + values[valuesById[343] = "INVALID_SERVICE_ENDPOINT"] = 343; + values[valuesById[344] = "INVALID_GOSSIP_CA_CERTIFICATE"] = 344; + values[valuesById[345] = "INVALID_GRPC_CERTIFICATE"] = 345; + values[valuesById[346] = "INVALID_MAX_AUTO_ASSOCIATIONS"] = 346; + values[valuesById[347] = "MAX_NODES_CREATED"] = 347; + values[valuesById[348] = "IP_FQDN_CANNOT_BE_SET_FOR_SAME_ENDPOINT"] = 348; + values[valuesById[349] = "GOSSIP_ENDPOINT_CANNOT_HAVE_FQDN"] = 349; + values[valuesById[350] = "FQDN_SIZE_TOO_LARGE"] = 350; + values[valuesById[351] = "INVALID_ENDPOINT"] = 351; + values[valuesById[352] = "GOSSIP_ENDPOINTS_EXCEEDED_LIMIT"] = 352; + values[valuesById[353] = "TOKEN_REFERENCE_REPEATED"] = 353; + values[valuesById[354] = "INVALID_OWNER_ID"] = 354; + values[valuesById[355] = "TOKEN_REFERENCE_LIST_SIZE_LIMIT_EXCEEDED"] = 355; + values[valuesById[356] = "SERVICE_ENDPOINTS_EXCEEDED_LIMIT"] = 356; + values[valuesById[357] = "INVALID_IPV4_ADDRESS"] = 357; + values[valuesById[358] = "EMPTY_TOKEN_REFERENCE_LIST"] = 358; + values[valuesById[359] = "UPDATE_NODE_ACCOUNT_NOT_ALLOWED"] = 359; + values[valuesById[360] = "TOKEN_HAS_NO_METADATA_OR_SUPPLY_KEY"] = 360; + values[valuesById[361] = "EMPTY_PENDING_AIRDROP_ID_LIST"] = 361; + values[valuesById[362] = "PENDING_AIRDROP_ID_REPEATED"] = 362; + values[valuesById[363] = "PENDING_AIRDROP_ID_LIST_TOO_LONG"] = 363; + values[valuesById[364] = "PENDING_NFT_AIRDROP_ALREADY_EXISTS"] = 364; + values[valuesById[365] = "ACCOUNT_HAS_PENDING_AIRDROPS"] = 365; + values[valuesById[366] = "THROTTLED_AT_CONSENSUS"] = 366; + values[valuesById[367] = "INVALID_PENDING_AIRDROP_ID"] = 367; + values[valuesById[368] = "TOKEN_AIRDROP_WITH_FALLBACK_ROYALTY"] = 368; + values[valuesById[369] = "INVALID_TOKEN_IN_PENDING_AIRDROP"] = 369; + values[valuesById[370] = "SCHEDULE_EXPIRY_IS_BUSY"] = 370; + values[valuesById[371] = "INVALID_GRPC_CERTIFICATE_HASH"] = 371; + values[valuesById[372] = "MISSING_EXPIRY_TIME"] = 372; + values[valuesById[373] = "NO_SCHEDULING_ALLOWED_AFTER_SCHEDULED_RECURSION"] = 373; + values[valuesById[374] = "RECURSIVE_SCHEDULING_LIMIT_REACHED"] = 374; + values[valuesById[375] = "WAITING_FOR_LEDGER_ID"] = 375; + values[valuesById[376] = "MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED"] = 376; + values[valuesById[377] = "FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS"] = 377; + values[valuesById[378] = "INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST"] = 378; + values[valuesById[379] = "INVALID_FEE_SCHEDULE_KEY"] = 379; + values[valuesById[380] = "FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED"] = 380; + values[valuesById[381] = "FEE_SCHEDULE_KEY_NOT_SET"] = 381; + values[valuesById[382] = "MAX_CUSTOM_FEE_LIMIT_EXCEEDED"] = 382; + values[valuesById[383] = "NO_VALID_MAX_CUSTOM_FEE"] = 383; + values[valuesById[384] = "INVALID_MAX_CUSTOM_FEES"] = 384; + values[valuesById[385] = "DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST"] = 385; + values[valuesById[386] = "DUPLICATE_ACCOUNT_ID_IN_MAX_CUSTOM_FEE_LIST"] = 386; + values[valuesById[387] = "MAX_CUSTOM_FEES_IS_NOT_SUPPORTED"] = 387; + values[valuesById[388] = "BATCH_LIST_EMPTY"] = 388; + values[valuesById[389] = "BATCH_LIST_CONTAINS_DUPLICATES"] = 389; + values[valuesById[390] = "BATCH_TRANSACTION_IN_BLACKLIST"] = 390; + values[valuesById[391] = "INNER_TRANSACTION_FAILED"] = 391; + values[valuesById[392] = "MISSING_BATCH_KEY"] = 392; + values[valuesById[393] = "BATCH_KEY_SET_ON_NON_INNER_TRANSACTION"] = 393; + values[valuesById[394] = "INVALID_BATCH_KEY"] = 394; + values[valuesById[395] = "SCHEDULE_EXPIRY_NOT_CONFIGURABLE"] = 395; + values[valuesById[396] = "CREATING_SYSTEM_ENTITIES"] = 396; + values[valuesById[397] = "THROTTLE_GROUP_LCM_OVERFLOW"] = 397; + values[valuesById[398] = "AIRDROP_CONTAINS_MULTIPLE_SENDERS_FOR_A_TOKEN"] = 398; + values[valuesById[399] = "GRPC_WEB_PROXY_NOT_SUPPORTED"] = 399; + values[valuesById[400] = "NFT_TRANSFERS_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE"] = 400; + return values; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/src/minimal/util_prng_transaction.d.ts b/packages/proto/src/minimal/util_prng_transaction.d.ts new file mode 100644 index 0000000000..fa84a8530c --- /dev/null +++ b/packages/proto/src/minimal/util_prng_transaction.d.ts @@ -0,0 +1,6387 @@ +import * as $protobuf from "protobufjs"; +import Long = require("long"); +export = hashgraph_util_prng_transaction; + +declare namespace hashgraph_util_prng_transaction { + + + /** Namespace proto. */ + namespace proto { + + /** Properties of a Transaction. */ + interface ITransaction { + + /** A valid, serialized, `SignedTransaction` message. */ + signedTransactionBytes?: (Uint8Array|null); + } + + /** A wrapper around signed transaction bytes for utility PRNG. */ + class Transaction implements ITransaction { + + /** + * Constructs a new Transaction. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransaction); + + /** A valid, serialized, `SignedTransaction` message. */ + public signedTransactionBytes: Uint8Array; + + /** + * Creates a new Transaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Transaction instance + */ + public static create(properties?: proto.ITransaction): proto.Transaction; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @param m Transaction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransaction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Transaction; + + /** + * Gets the default type url for Transaction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UtilPrngTransactionBody. */ + interface IUtilPrngTransactionBody { + + /** A range for the requested value. */ + range?: (number|null); + } + + /** Request a deterministic pseudo-random number. */ + class UtilPrngTransactionBody implements IUtilPrngTransactionBody { + + /** + * Constructs a new UtilPrngTransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.IUtilPrngTransactionBody); + + /** A range for the requested value. */ + public range: number; + + /** + * Creates a new UtilPrngTransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns UtilPrngTransactionBody instance + */ + public static create(properties?: proto.IUtilPrngTransactionBody): proto.UtilPrngTransactionBody; + + /** + * Encodes the specified UtilPrngTransactionBody message. Does not implicitly {@link proto.UtilPrngTransactionBody.verify|verify} messages. + * @param m UtilPrngTransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IUtilPrngTransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UtilPrngTransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UtilPrngTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.UtilPrngTransactionBody; + + /** + * Gets the default type url for UtilPrngTransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionBody. */ + interface ITransactionBody { + + /** A transaction identifier. */ + transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + transactionFee?: (Long|null); + + /** A maximum duration in which to execute this transaction. */ + transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + memo?: (string|null); + + /** The public key of the trusted batch assembler. */ + batchKey?: (proto.IKey|null); + + /** Provide a deterministic pseudorandom number. */ + utilPrng?: (proto.IUtilPrngTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + maxCustomFees?: (proto.ICustomFeeLimit[]|null); + } + + /** A transaction body for utility PRNG. */ + class TransactionBody implements ITransactionBody { + + /** + * Constructs a new TransactionBody. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionBody); + + /** A transaction identifier. */ + public transactionID?: (proto.ITransactionID|null); + + /** A node account identifier. */ + public nodeAccountID?: (proto.IAccountID|null); + + /** A maximum transaction fee, in tinybar. */ + public transactionFee: Long; + + /** A maximum duration in which to execute this transaction. */ + public transactionValidDuration?: (proto.IDuration|null); + + /** A short description for this transaction. */ + public memo: string; + + /** The public key of the trusted batch assembler. */ + public batchKey?: (proto.IKey|null); + + /** Provide a deterministic pseudorandom number. */ + public utilPrng?: (proto.IUtilPrngTransactionBody|null); + + /** A list of maximum custom fees that the users are willing to pay. */ + public maxCustomFees: proto.ICustomFeeLimit[]; + + /** TransactionBody data. */ + public data?: "utilPrng"; + + /** + * Creates a new TransactionBody instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionBody instance + */ + public static create(properties?: proto.ITransactionBody): proto.TransactionBody; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @param m TransactionBody message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionBody, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionBody; + + /** + * Gets the default type url for TransactionBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionList. */ + interface ITransactionList { + + /** TransactionList transactionList */ + transactionList?: (proto.ITransaction[]|null); + } + + /** Represents a TransactionList. */ + class TransactionList implements ITransactionList { + + /** + * Constructs a new TransactionList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionList); + + /** TransactionList transactionList. */ + public transactionList: proto.ITransaction[]; + + /** + * Creates a new TransactionList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionList instance + */ + public static create(properties?: proto.ITransactionList): proto.TransactionList; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @param m TransactionList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionList; + + /** + * Gets the default type url for TransactionList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShardID. */ + interface IShardID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + } + + /** + * A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + */ + class ShardID implements IShardID { + + /** + * Constructs a new ShardID. + * @param [p] Properties to set + */ + constructor(p?: proto.IShardID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** + * Creates a new ShardID instance using the specified properties. + * @param [properties] Properties to set + * @returns ShardID instance + */ + public static create(properties?: proto.IShardID): proto.ShardID; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @param m ShardID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IShardID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ShardID; + + /** + * Gets the default type url for ShardID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmID. */ + interface IRealmID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + } + + /** + * A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + */ + class RealmID implements IRealmID { + + /** + * Constructs a new RealmID. + * @param [p] Properties to set + */ + constructor(p?: proto.IRealmID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * Creates a new RealmID instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmID instance + */ + public static create(properties?: proto.IRealmID): proto.RealmID; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @param m RealmID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRealmID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RealmID; + + /** + * Gets the default type url for RealmID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenID. */ + interface ITokenID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number token identifier. */ + tokenNum?: (Long|null); + } + + /** + * Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + */ + class TokenID implements ITokenID { + + /** + * Constructs a new TokenID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number token identifier. */ + public tokenNum: Long; + + /** + * Creates a new TokenID instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenID instance + */ + public static create(properties?: proto.ITokenID): proto.TokenID; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @param m TokenID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenID; + + /** + * Gets the default type url for TokenID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + */ + enum BlockHashAlgorithm { + SHA2_384 = 0 + } + + /** Properties of an AccountID. */ + interface IAccountID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + alias?: (Uint8Array|null); + } + + /** + * A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + */ + class AccountID implements IAccountID { + + /** + * Constructs a new AccountID. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + */ + public accountNum?: (Long|null); + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + public alias?: (Uint8Array|null); + + /** AccountID account. */ + public account?: ("accountNum"|"alias"); + + /** + * Creates a new AccountID instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountID instance + */ + public static create(properties?: proto.IAccountID): proto.AccountID; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @param m AccountID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountID; + + /** + * Gets the default type url for AccountID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftID. */ + interface INftID { + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + serialNumber?: (Long|null); + } + + /** + * An identifier for a unique token (or "NFT"), used by both contract + * and token services. + */ + class NftID implements INftID { + + /** + * Constructs a new NftID. + * @param [p] Properties to set + */ + constructor(p?: proto.INftID); + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + */ + public token_ID?: (proto.ITokenID|null); + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + */ + public serialNumber: Long; + + /** + * Creates a new NftID instance using the specified properties. + * @param [properties] Properties to set + * @returns NftID instance + */ + public static create(properties?: proto.INftID): proto.NftID; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @param m NftID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftID; + + /** + * Gets the default type url for NftID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileID. */ + interface IFileID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number file identifier, unique within its realm and shard. */ + fileNum?: (Long|null); + } + + /** An identifier for a File within the network. */ + class FileID implements IFileID { + + /** + * Constructs a new FileID. + * @param [p] Properties to set + */ + constructor(p?: proto.IFileID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number file identifier, unique within its realm and shard. */ + public fileNum: Long; + + /** + * Creates a new FileID instance using the specified properties. + * @param [properties] Properties to set + * @returns FileID instance + */ + public static create(properties?: proto.IFileID): proto.FileID; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @param m FileID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFileID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FileID; + + /** + * Gets the default type url for FileID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContractID. */ + interface IContractID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number contract identifier, unique within its realm and shard. */ + contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + evmAddress?: (Uint8Array|null); + } + + /** An identifier for a smart contract within the network. */ + class ContractID implements IContractID { + + /** + * Constructs a new ContractID. + * @param [p] Properties to set + */ + constructor(p?: proto.IContractID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number contract identifier, unique within its realm and shard. */ + public contractNum?: (Long|null); + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + public evmAddress?: (Uint8Array|null); + + /** ContractID contract. */ + public contract?: ("contractNum"|"evmAddress"); + + /** + * Creates a new ContractID instance using the specified properties. + * @param [properties] Properties to set + * @returns ContractID instance + */ + public static create(properties?: proto.IContractID): proto.ContractID; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @param m ContractID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IContractID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ContractID; + + /** + * Gets the default type url for ContractID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TopicID. */ + interface ITopicID { + + /** A whole number shard identifier. */ + shardNum?: (Long|null); + + /** A whole number realm identifier. */ + realmNum?: (Long|null); + + /** A whole number topic identifier, unique within its realm and shard. */ + topicNum?: (Long|null); + } + + /** + * An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + */ + class TopicID implements ITopicID { + + /** + * Constructs a new TopicID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITopicID); + + /** A whole number shard identifier. */ + public shardNum: Long; + + /** A whole number realm identifier. */ + public realmNum: Long; + + /** A whole number topic identifier, unique within its realm and shard. */ + public topicNum: Long; + + /** + * Creates a new TopicID instance using the specified properties. + * @param [properties] Properties to set + * @returns TopicID instance + */ + public static create(properties?: proto.ITopicID): proto.TopicID; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @param m TopicID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITopicID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TopicID; + + /** + * Gets the default type url for TopicID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScheduleID. */ + interface IScheduleID { + + /** A whole number shard */ + shardNum?: (Long|null); + + /** A whole number realm */ + realmNum?: (Long|null); + + /** A whole number schedule, unique within its realm and shard */ + scheduleNum?: (Long|null); + } + + /** An unique identifier for a Schedule */ + class ScheduleID implements IScheduleID { + + /** + * Constructs a new ScheduleID. + * @param [p] Properties to set + */ + constructor(p?: proto.IScheduleID); + + /** A whole number shard */ + public shardNum: Long; + + /** A whole number realm */ + public realmNum: Long; + + /** A whole number schedule, unique within its realm and shard */ + public scheduleNum: Long; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @param [properties] Properties to set + * @returns ScheduleID instance + */ + public static create(properties?: proto.IScheduleID): proto.ScheduleID; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @param m ScheduleID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IScheduleID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ScheduleID; + + /** + * Gets the default type url for ScheduleID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionID. */ + interface ITransactionID { + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + scheduled?: (boolean|null); + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + nonce?: (number|null); + } + + /** + * A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + */ + class TransactionID implements ITransactionID { + + /** + * Constructs a new TransactionID. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionID); + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + */ + public transactionValidStart?: (proto.ITimestamp|null); + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + */ + public accountID?: (proto.IAccountID|null); + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + */ + public scheduled: boolean; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + public nonce: number; + + /** + * Creates a new TransactionID instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionID instance + */ + public static create(properties?: proto.ITransactionID): proto.TransactionID; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @param m TransactionID message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionID, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionID; + + /** + * Gets the default type url for TransactionID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccountAmount. */ + interface IAccountAmount { + + /** An account identifier that will send or receive token(s). */ + accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + amount?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + */ + class AccountAmount implements IAccountAmount { + + /** + * Constructs a new AccountAmount. + * @param [p] Properties to set + */ + constructor(p?: proto.IAccountAmount); + + /** An account identifier that will send or receive token(s). */ + public accountID?: (proto.IAccountID|null); + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + */ + public amount: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns AccountAmount instance + */ + public static create(properties?: proto.IAccountAmount): proto.AccountAmount; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @param m AccountAmount message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAccountAmount, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AccountAmount; + + /** + * Gets the default type url for AccountAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferList. */ + interface ITransferList { + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + accountAmounts?: (proto.IAccountAmount[]|null); + } + + /** + * A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + */ + class TransferList implements ITransferList { + + /** + * Constructs a new TransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransferList); + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + public accountAmounts: proto.IAccountAmount[]; + + /** + * Creates a new TransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferList instance + */ + public static create(properties?: proto.ITransferList): proto.TransferList; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @param m TransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransferList; + + /** + * Gets the default type url for TransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NftTransfer. */ + interface INftTransfer { + + /** An Account identifier for the sender. */ + senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + serialNumber?: (Long|null); + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + isApproval?: (boolean|null); + } + + /** + * A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + */ + class NftTransfer implements INftTransfer { + + /** + * Constructs a new NftTransfer. + * @param [p] Properties to set + */ + constructor(p?: proto.INftTransfer); + + /** An Account identifier for the sender. */ + public senderAccountID?: (proto.IAccountID|null); + + /** An Account identifier for the receiver. */ + public receiverAccountID?: (proto.IAccountID|null); + + /** A serial number for the NFT to transfer. */ + public serialNumber: Long; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + public isApproval: boolean; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @param [properties] Properties to set + * @returns NftTransfer instance + */ + public static create(properties?: proto.INftTransfer): proto.NftTransfer; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @param m NftTransfer message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INftTransfer, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NftTransfer; + + /** + * Gets the default type url for NftTransfer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenTransferList. */ + interface ITokenTransferList { + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + transfers?: (proto.IAccountAmount[]|null); + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + nftTransfers?: (proto.INftTransfer[]|null); + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + expectedDecimals?: (google.protobuf.IUInt32Value|null); + } + + /** + * A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + */ + class TokenTransferList implements ITokenTransferList { + + /** + * Constructs a new TokenTransferList. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenTransferList); + + /** + * A token identifier.
+ * This is the token to be transferred. + */ + public token?: (proto.ITokenID|null); + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + */ + public transfers: proto.IAccountAmount[]; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + */ + public nftTransfers: proto.INftTransfer[]; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + public expectedDecimals?: (google.protobuf.IUInt32Value|null); + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenTransferList instance + */ + public static create(properties?: proto.ITokenTransferList): proto.TokenTransferList; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @param m TokenTransferList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenTransferList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenTransferList; + + /** + * Gets the default type url for TokenTransferList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fraction. */ + interface IFraction { + + /** A fractional number's numerator. */ + numerator?: (Long|null); + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + denominator?: (Long|null); + } + + /** + * A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + */ + class Fraction implements IFraction { + + /** + * Constructs a new Fraction. + * @param [p] Properties to set + */ + constructor(p?: proto.IFraction); + + /** A fractional number's numerator. */ + public numerator: Long; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + public denominator: Long; + + /** + * Creates a new Fraction instance using the specified properties. + * @param [properties] Properties to set + * @returns Fraction instance + */ + public static create(properties?: proto.IFraction): proto.Fraction; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @param m Fraction message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFraction, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Fraction; + + /** + * Gets the default type url for Fraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ */ + enum TokenType { + FUNGIBLE_COMMON = 0, + NON_FUNGIBLE_UNIQUE = 1 + } + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + */ + enum SubType { + DEFAULT = 0, + TOKEN_FUNGIBLE_COMMON = 1, + TOKEN_NON_FUNGIBLE_UNIQUE = 2, + TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES = 3, + TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES = 4, + SCHEDULE_CREATE_CONTRACT_CALL = 5, + TOPIC_CREATE_WITH_CUSTOM_FEES = 6, + SUBMIT_MESSAGE_WITH_CUSTOM_FEES = 7 + } + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + */ + enum TokenSupplyType { + INFINITE = 0, + FINITE = 1 + } + + /** Types of validation strategies for token keys. */ + enum TokenKeyValidation { + FULL_VALIDATION = 0, + NO_VALIDATION = 1 + } + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenFreezeStatus { + FreezeNotApplicable = 0, + Frozen = 1, + Unfrozen = 2 + } + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + */ + enum TokenKycStatus { + KycNotApplicable = 0, + Granted = 1, + Revoked = 2 + } + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + */ + enum TokenPauseStatus { + PauseNotApplicable = 0, + Paused = 1, + Unpaused = 2 + } + + /** Properties of a Key. */ + interface IKey { + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + delegatableContractId?: (proto.IContractID|null); + } + + /** + * A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + */ + class Key implements IKey { + + /** + * Constructs a new Key. + * @param [p] Properties to set + */ + constructor(p?: proto.IKey); + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + */ + public contractID?: (proto.IContractID|null); + + /** An array of Ed25519 public key bytes. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + */ + public ECDSA_384?: (Uint8Array|null); + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + */ + public thresholdKey?: (proto.IThresholdKey|null); + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + */ + public keyList?: (proto.IKeyList|null); + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + public delegatableContractId?: (proto.IContractID|null); + + /** Key key. */ + public key?: ("contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"); + + /** + * Creates a new Key instance using the specified properties. + * @param [properties] Properties to set + * @returns Key instance + */ + public static create(properties?: proto.IKey): proto.Key; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @param m Key message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Key message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Key; + + /** + * Gets the default type url for Key + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdKey. */ + interface IThresholdKey { + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + threshold?: (number|null); + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + keys?: (proto.IKeyList|null); + } + + /** + * A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + */ + class ThresholdKey implements IThresholdKey { + + /** + * Constructs a new ThresholdKey. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdKey); + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + */ + public threshold: number; + + /** A list of the keys that MAY satisfy signature requirements of this key. */ + public keys?: (proto.IKeyList|null); + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdKey instance + */ + public static create(properties?: proto.IThresholdKey): proto.ThresholdKey; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @param m ThresholdKey message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdKey, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdKey; + + /** + * Gets the default type url for ThresholdKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KeyList. */ + interface IKeyList { + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + keys?: (proto.IKey[]|null); + } + + /** + * A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + */ + class KeyList implements IKeyList { + + /** + * Constructs a new KeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IKeyList); + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ */ + public keys: proto.IKey[]; + + /** + * Creates a new KeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyList instance + */ + public static create(properties?: proto.IKeyList): proto.KeyList; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @param m KeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.KeyList; + + /** + * Gets the default type url for KeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Signature. */ + interface ISignature { + + /** Smart contract virtual signature (always length zero). */ + contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + ECDSA_384?: (Uint8Array|null); + + /** + * 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?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + signatureList?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class Signature implements ISignature { + + /** + * Constructs a new Signature. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignature); + + /** Smart contract virtual signature (always length zero). */ + public contract?: (Uint8Array|null); + + /** Ed25519 signature bytes. */ + public ed25519?: (Uint8Array|null); + + /** RSA-3072 signature bytes. */ + public RSA_3072?: (Uint8Array|null); + + /** ECDSA p-384 signature bytes. */ + public ECDSA_384?: (Uint8Array|null); + + /** + * 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. + */ + public thresholdSignature?: (proto.IThresholdSignature|null); + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + public signatureList?: (proto.ISignatureList|null); + + /** Signature signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"); + + /** + * Creates a new Signature instance using the specified properties. + * @param [properties] Properties to set + * @returns Signature instance + */ + public static create(properties?: proto.ISignature): proto.Signature; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @param m Signature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Signature; + + /** + * Gets the default type url for Signature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ThresholdSignature. */ + interface IThresholdSignature { + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + sigs?: (proto.ISignatureList|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + */ + class ThresholdSignature implements IThresholdSignature { + + /** + * Constructs a new ThresholdSignature. + * @param [p] Properties to set + */ + constructor(p?: proto.IThresholdSignature); + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + public sigs?: (proto.ISignatureList|null); + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns ThresholdSignature instance + */ + public static create(properties?: proto.IThresholdSignature): proto.ThresholdSignature; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @param m ThresholdSignature message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IThresholdSignature, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ThresholdSignature; + + /** + * Gets the default type url for ThresholdSignature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureList. */ + interface ISignatureList { + + /** Each signature corresponds to a Key in the KeyList. */ + sigs?: (proto.ISignature[]|null); + } + + /** + * This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + */ + class SignatureList implements ISignatureList { + + /** + * Constructs a new SignatureList. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureList); + + /** Each signature corresponds to a Key in the KeyList. */ + public sigs: proto.ISignature[]; + + /** + * Creates a new SignatureList instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureList instance + */ + public static create(properties?: proto.ISignatureList): proto.SignatureList; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @param m SignatureList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureList; + + /** + * Gets the default type url for SignatureList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignaturePair. */ + interface ISignaturePair { + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + pubKeyPrefix?: (Uint8Array|null); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + ECDSASecp256k1?: (Uint8Array|null); + } + + /** + * A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + */ + class SignaturePair implements ISignaturePair { + + /** + * Constructs a new SignaturePair. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignaturePair); + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ */ + public pubKeyPrefix: Uint8Array; + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + */ + public contract?: (Uint8Array|null); + + /** An Ed25519 signature. */ + public ed25519?: (Uint8Array|null); + + /** + * This option is not supported.
+ * A RSA-3072 signature. + */ + public RSA_3072?: (Uint8Array|null); + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + */ + public ECDSA_384?: (Uint8Array|null); + + /** An ECDSA(secp256k1) signature. */ + public ECDSASecp256k1?: (Uint8Array|null); + + /** SignaturePair signature. */ + public signature?: ("contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @param [properties] Properties to set + * @returns SignaturePair instance + */ + public static create(properties?: proto.ISignaturePair): proto.SignaturePair; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @param m SignaturePair message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignaturePair, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignaturePair; + + /** + * Gets the default type url for SignaturePair + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignatureMap. */ + interface ISignatureMap { + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + sigPair?: (proto.ISignaturePair[]|null); + } + + /** + * A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + */ + class SignatureMap implements ISignatureMap { + + /** + * Constructs a new SignatureMap. + * @param [p] Properties to set + */ + constructor(p?: proto.ISignatureMap); + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + public sigPair: proto.ISignaturePair[]; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @param [properties] Properties to set + * @returns SignatureMap instance + */ + public static create(properties?: proto.ISignatureMap): proto.SignatureMap; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @param m SignatureMap message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISignatureMap, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SignatureMap; + + /** + * Gets the default type url for SignatureMap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** The transactions and queries supported by Hedera Hashgraph. */ + enum HederaFunctionality { + NONE = 0, + CryptoTransfer = 1, + CryptoUpdate = 2, + CryptoDelete = 3, + CryptoAddLiveHash = 4, + CryptoDeleteLiveHash = 5, + ContractCall = 6, + ContractCreate = 7, + ContractUpdate = 8, + FileCreate = 9, + FileAppend = 10, + FileUpdate = 11, + FileDelete = 12, + CryptoGetAccountBalance = 13, + CryptoGetAccountRecords = 14, + CryptoGetInfo = 15, + ContractCallLocal = 16, + ContractGetInfo = 17, + ContractGetBytecode = 18, + GetBySolidityID = 19, + GetByKey = 20, + CryptoGetLiveHash = 21, + CryptoGetStakers = 22, + FileGetContents = 23, + FileGetInfo = 24, + TransactionGetRecord = 25, + ContractGetRecords = 26, + CryptoCreate = 27, + SystemDelete = 28, + SystemUndelete = 29, + ContractDelete = 30, + Freeze = 31, + CreateTransactionRecord = 32, + CryptoAccountAutoRenew = 33, + ContractAutoRenew = 34, + GetVersionInfo = 35, + TransactionGetReceipt = 36, + ConsensusCreateTopic = 50, + ConsensusUpdateTopic = 51, + ConsensusDeleteTopic = 52, + ConsensusGetTopicInfo = 53, + ConsensusSubmitMessage = 54, + UncheckedSubmit = 55, + TokenCreate = 56, + TokenGetInfo = 58, + TokenFreezeAccount = 59, + TokenUnfreezeAccount = 60, + TokenGrantKycToAccount = 61, + TokenRevokeKycFromAccount = 62, + TokenDelete = 63, + TokenUpdate = 64, + TokenMint = 65, + TokenBurn = 66, + TokenAccountWipe = 67, + TokenAssociateToAccount = 68, + TokenDissociateFromAccount = 69, + ScheduleCreate = 70, + ScheduleDelete = 71, + ScheduleSign = 72, + ScheduleGetInfo = 73, + TokenGetAccountNftInfos = 74, + TokenGetNftInfo = 75, + TokenGetNftInfos = 76, + TokenFeeScheduleUpdate = 77, + NetworkGetExecutionTime = 78, + TokenPause = 79, + TokenUnpause = 80, + CryptoApproveAllowance = 81, + CryptoDeleteAllowance = 82, + GetAccountDetails = 83, + EthereumTransaction = 84, + NodeStakeUpdate = 85, + UtilPrng = 86, + TransactionGetFastRecord = 87, + TokenUpdateNfts = 88, + NodeCreate = 89, + NodeUpdate = 90, + NodeDelete = 91, + TokenReject = 92, + TokenAirdrop = 93, + TokenCancelAirdrop = 94, + TokenClaimAirdrop = 95, + StateSignatureTransaction = 100, + HintsKeyPublication = 101, + HintsPreprocessingVote = 102, + HintsPartialSignature = 103, + HistoryAssemblySignature = 104, + HistoryProofKeyPublication = 105, + HistoryProofVote = 106, + CrsPublication = 107, + AtomicBatch = 108 + } + + /** Properties of a FeeComponents. */ + interface IFeeComponents { + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + min?: (Long|null); + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + max?: (Long|null); + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + constant?: (Long|null); + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + bpt?: (Long|null); + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + vpt?: (Long|null); + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + rbh?: (Long|null); + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + sbh?: (Long|null); + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + gas?: (Long|null); + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + tv?: (Long|null); + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + bpr?: (Long|null); + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + sbpr?: (Long|null); + } + + /** + * A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + */ + class FeeComponents implements IFeeComponents { + + /** + * Constructs a new FeeComponents. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeComponents); + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + */ + public min: Long; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + */ + public max: Long; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + */ + public constant: Long; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + */ + public bpt: Long; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + */ + public vpt: Long; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + */ + public rbh: Long; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + */ + public sbh: Long; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + */ + public gas: Long; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + */ + public tv: Long; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + */ + public bpr: Long; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + public sbpr: Long; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeComponents instance + */ + public static create(properties?: proto.IFeeComponents): proto.FeeComponents; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @param m FeeComponents message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeComponents, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeComponents; + + /** + * Gets the default type url for FeeComponents + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransactionFeeSchedule. */ + interface ITransactionFeeSchedule { + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + hederaFunctionality?: (proto.HederaFunctionality|null); + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + fees?: (proto.IFeeData[]|null); + } + + /** The fee schedule for a specific transaction or query based on the fee data. */ + class TransactionFeeSchedule implements ITransactionFeeSchedule { + + /** + * Constructs a new TransactionFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ITransactionFeeSchedule); + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + */ + public hederaFunctionality: proto.HederaFunctionality; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + */ + public feeData?: (proto.IFeeData|null); + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + public fees: proto.IFeeData[]; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionFeeSchedule instance + */ + public static create(properties?: proto.ITransactionFeeSchedule): proto.TransactionFeeSchedule; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @param m TransactionFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITransactionFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TransactionFeeSchedule; + + /** + * Gets the default type url for TransactionFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeData. */ + interface IFeeData { + + /** Fee components to be paid to the submitting node. */ + nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + subType?: (proto.SubType|null); + } + + /** + * A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + */ + class FeeData implements IFeeData { + + /** + * Constructs a new FeeData. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeData); + + /** Fee components to be paid to the submitting node. */ + public nodedata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + */ + public networkdata?: (proto.IFeeComponents|null); + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + */ + public servicedata?: (proto.IFeeComponents|null); + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + public subType: proto.SubType; + + /** + * Creates a new FeeData instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeData instance + */ + public static create(properties?: proto.IFeeData): proto.FeeData; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @param m FeeData message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeData, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeData; + + /** + * Gets the default type url for FeeData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeSchedule. */ + interface IFeeSchedule { + + /** Sets of fee coefficients for various transaction or query types. */ + transactionFeeSchedule?: (proto.ITransactionFeeSchedule[]|null); + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + expiryTime?: (proto.ITimestampSeconds|null); + } + + /** + * A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + */ + class FeeSchedule implements IFeeSchedule { + + /** + * Constructs a new FeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeSchedule); + + /** Sets of fee coefficients for various transaction or query types. */ + public transactionFeeSchedule: proto.ITransactionFeeSchedule[]; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + public expiryTime?: (proto.ITimestampSeconds|null); + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeSchedule instance + */ + public static create(properties?: proto.IFeeSchedule): proto.FeeSchedule; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @param m FeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeSchedule; + + /** + * Gets the default type url for FeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrentAndNextFeeSchedule. */ + interface ICurrentAndNextFeeSchedule { + + /** A current, unexpired, fee schedule. */ + currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + nextFeeSchedule?: (proto.IFeeSchedule|null); + } + + /** + * The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + */ + class CurrentAndNextFeeSchedule implements ICurrentAndNextFeeSchedule { + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @param [p] Properties to set + */ + constructor(p?: proto.ICurrentAndNextFeeSchedule); + + /** A current, unexpired, fee schedule. */ + public currentFeeSchedule?: (proto.IFeeSchedule|null); + + /** A future fee schedule to use when the current schedule expires. */ + public nextFeeSchedule?: (proto.IFeeSchedule|null); + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrentAndNextFeeSchedule instance + */ + public static create(properties?: proto.ICurrentAndNextFeeSchedule): proto.CurrentAndNextFeeSchedule; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @param m CurrentAndNextFeeSchedule message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICurrentAndNextFeeSchedule, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CurrentAndNextFeeSchedule; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceEndpoint. */ + interface IServiceEndpoint { + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + ipAddressV4?: (Uint8Array|null); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + port?: (number|null); + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + domainName?: (string|null); + } + + /** + * A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + */ + class ServiceEndpoint implements IServiceEndpoint { + + /** + * Constructs a new ServiceEndpoint. + * @param [p] Properties to set + */ + constructor(p?: proto.IServiceEndpoint); + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + */ + public ipAddressV4: Uint8Array; + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + */ + public port: number; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + public domainName: string; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceEndpoint instance + */ + public static create(properties?: proto.IServiceEndpoint): proto.ServiceEndpoint; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @param m ServiceEndpoint message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServiceEndpoint, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServiceEndpoint; + + /** + * Gets the default type url for ServiceEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddress. */ + interface INodeAddress { + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + ipAddress?: (Uint8Array|null); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + portno?: (number|null); + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + memo?: (Uint8Array|null); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + RSA_PubKey?: (string|null); + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + nodeId?: (Long|null); + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + nodeCertHash?: (Uint8Array|null); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + serviceEndpoint?: (proto.IServiceEndpoint[]|null); + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + description?: (string|null); + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + stake?: (Long|null); + } + + /** + * 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + */ + class NodeAddress implements INodeAddress { + + /** + * Constructs a new NodeAddress. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddress); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + */ + public ipAddress: Uint8Array; + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + */ + public portno: number; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + */ + public memo: Uint8Array; + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + */ + public RSA_PubKey: string; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + */ + public nodeId: Long; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + */ + public nodeAccountId?: (proto.IAccountID|null); + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + */ + public nodeCertHash: Uint8Array; + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + */ + public serviceEndpoint: proto.IServiceEndpoint[]; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + */ + public description: string; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + public stake: Long; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddress instance + */ + public static create(properties?: proto.INodeAddress): proto.NodeAddress; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @param m NodeAddress message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddress, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddress; + + /** + * Gets the default type url for NodeAddress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeAddressBook. */ + interface INodeAddressBook { + + /** Published data for all nodes in the network */ + nodeAddress?: (proto.INodeAddress[]|null); + } + + /** + * A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + */ + class NodeAddressBook implements INodeAddressBook { + + /** + * Constructs a new NodeAddressBook. + * @param [p] Properties to set + */ + constructor(p?: proto.INodeAddressBook); + + /** Published data for all nodes in the network */ + public nodeAddress: proto.INodeAddress[]; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAddressBook instance + */ + public static create(properties?: proto.INodeAddressBook): proto.NodeAddressBook; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @param m NodeAddressBook message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.INodeAddressBook, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.NodeAddressBook; + + /** + * Gets the default type url for NodeAddressBook + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticVersion. */ + interface ISemanticVersion { + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + major?: (number|null); + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + minor?: (number|null); + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + patch?: (number|null); + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + pre?: (string|null); + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + build?: (string|null); + } + + /** + * A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + */ + class SemanticVersion implements ISemanticVersion { + + /** + * Constructs a new SemanticVersion. + * @param [p] Properties to set + */ + constructor(p?: proto.ISemanticVersion); + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ */ + public major: number; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + */ + public minor: number; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + */ + public patch: number; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + */ + public pre: string; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + public build: string; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticVersion instance + */ + public static create(properties?: proto.ISemanticVersion): proto.SemanticVersion; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @param m SemanticVersion message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISemanticVersion, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.SemanticVersion; + + /** + * Gets the default type url for SemanticVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Setting. */ + interface ISetting { + + /** A name for this setting property. */ + name?: (string|null); + + /** A value for this setting property. */ + value?: (string|null); + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + data?: (Uint8Array|null); + } + + /** + * A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + */ + class Setting implements ISetting { + + /** + * Constructs a new Setting. + * @param [p] Properties to set + */ + constructor(p?: proto.ISetting); + + /** A name for this setting property. */ + public name: string; + + /** A value for this setting property. */ + public value: string; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + public data: Uint8Array; + + /** + * Creates a new Setting instance using the specified properties. + * @param [properties] Properties to set + * @returns Setting instance + */ + public static create(properties?: proto.ISetting): proto.Setting; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @param m Setting message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ISetting, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Setting; + + /** + * Gets the default type url for Setting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicesConfigurationList. */ + interface IServicesConfigurationList { + + /** A List of `Setting` values, typically read from application properties. */ + nameValue?: (proto.ISetting[]|null); + } + + /** Setting values representing a source of runtime configuration information. */ + class ServicesConfigurationList implements IServicesConfigurationList { + + /** + * Constructs a new ServicesConfigurationList. + * @param [p] Properties to set + */ + constructor(p?: proto.IServicesConfigurationList); + + /** A List of `Setting` values, typically read from application properties. */ + public nameValue: proto.ISetting[]; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicesConfigurationList instance + */ + public static create(properties?: proto.IServicesConfigurationList): proto.ServicesConfigurationList; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @param m ServicesConfigurationList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IServicesConfigurationList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.ServicesConfigurationList; + + /** + * Gets the default type url for ServicesConfigurationList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenRelationship. */ + interface ITokenRelationship { + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + symbol?: (string|null); + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + balance?: (Long|null); + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + kycStatus?: (proto.TokenKycStatus|null); + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + freezeStatus?: (proto.TokenFreezeStatus|null); + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + decimals?: (number|null); + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + automaticAssociation?: (boolean|null); + } + + /** + * An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + */ + class TokenRelationship implements ITokenRelationship { + + /** + * Constructs a new TokenRelationship. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenRelationship); + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + */ + public symbol: string; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + */ + public balance: Long; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + */ + public kycStatus: proto.TokenKycStatus; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + */ + public freezeStatus: proto.TokenFreezeStatus; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + */ + public decimals: number; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + public automaticAssociation: boolean; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenRelationship instance + */ + public static create(properties?: proto.ITokenRelationship): proto.TokenRelationship; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @param m TokenRelationship message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenRelationship, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenRelationship; + + /** + * Gets the default type url for TokenRelationship + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalance. */ + interface ITokenBalance { + + /** A token identifier. */ + tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + balance?: (Long|null); + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + decimals?: (number|null); + } + + /** + * A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + */ + class TokenBalance implements ITokenBalance { + + /** + * Constructs a new TokenBalance. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalance); + + /** A token identifier. */ + public tokenId?: (proto.ITokenID|null); + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + */ + public balance: Long; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + public decimals: number; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalance instance + */ + public static create(properties?: proto.ITokenBalance): proto.TokenBalance; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @param m TokenBalance message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalance, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalance; + + /** + * Gets the default type url for TokenBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenBalances. */ + interface ITokenBalances { + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + tokenBalances?: (proto.ITokenBalance[]|null); + } + + /** + * A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + */ + class TokenBalances implements ITokenBalances { + + /** + * Constructs a new TokenBalances. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenBalances); + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + public tokenBalances: proto.ITokenBalance[]; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenBalances instance + */ + public static create(properties?: proto.ITokenBalances): proto.TokenBalances; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @param m TokenBalances message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenBalances, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenBalances; + + /** + * Gets the default type url for TokenBalances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TokenAssociation. */ + interface ITokenAssociation { + + /** A token identifier for the associated token. */ + tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + accountId?: (proto.IAccountID|null); + } + + /** + * An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + */ + class TokenAssociation implements ITokenAssociation { + + /** + * Constructs a new TokenAssociation. + * @param [p] Properties to set + */ + constructor(p?: proto.ITokenAssociation); + + /** A token identifier for the associated token. */ + public tokenId?: (proto.ITokenID|null); + + /** An account identifier for the associated account. */ + public accountId?: (proto.IAccountID|null); + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns TokenAssociation instance + */ + public static create(properties?: proto.ITokenAssociation): proto.TokenAssociation; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @param m TokenAssociation message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITokenAssociation, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TokenAssociation; + + /** + * Gets the default type url for TokenAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StakingInfo. */ + interface IStakingInfo { + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + declineReward?: (boolean|null); + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + pendingReward?: (Long|null); + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + stakedToMe?: (Long|null); + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + stakedNodeId?: (Long|null); + } + + /** + * Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + */ + class StakingInfo implements IStakingInfo { + + /** + * Constructs a new StakingInfo. + * @param [p] Properties to set + */ + constructor(p?: proto.IStakingInfo); + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + */ + public declineReward: boolean; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + */ + public stakePeriodStart?: (proto.ITimestamp|null); + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + */ + public pendingReward: Long; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + */ + public stakedToMe: Long; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + */ + public stakedAccountId?: (proto.IAccountID|null); + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + public stakedNodeId?: (Long|null); + + /** StakingInfo stakedId. */ + public stakedId?: ("stakedAccountId"|"stakedNodeId"); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns StakingInfo instance + */ + public static create(properties?: proto.IStakingInfo): proto.StakingInfo; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @param m StakingInfo message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IStakingInfo, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.StakingInfo; + + /** + * Gets the default type url for StakingInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropId. */ + interface IPendingAirdropId { + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + nonFungibleToken?: (proto.INftID|null); + } + + /** + * A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + */ + class PendingAirdropId implements IPendingAirdropId { + + /** + * Constructs a new PendingAirdropId. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropId); + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + */ + public senderId?: (proto.IAccountID|null); + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + */ + public receiverId?: (proto.IAccountID|null); + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + */ + public fungibleTokenType?: (proto.ITokenID|null); + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + public nonFungibleToken?: (proto.INftID|null); + + /** PendingAirdropId tokenReference. */ + public tokenReference?: ("fungibleTokenType"|"nonFungibleToken"); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropId instance + */ + public static create(properties?: proto.IPendingAirdropId): proto.PendingAirdropId; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @param m PendingAirdropId message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropId, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropId; + + /** + * Gets the default type url for PendingAirdropId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingAirdropValue. */ + interface IPendingAirdropValue { + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + amount?: (Long|null); + } + + /** + * A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + */ + class PendingAirdropValue implements IPendingAirdropValue { + + /** + * Constructs a new PendingAirdropValue. + * @param [p] Properties to set + */ + constructor(p?: proto.IPendingAirdropValue); + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + public amount: Long; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingAirdropValue instance + */ + public static create(properties?: proto.IPendingAirdropValue): proto.PendingAirdropValue; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @param m PendingAirdropValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IPendingAirdropValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.PendingAirdropValue; + + /** + * Gets the default type url for PendingAirdropValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** The number of seconds for this duration. */ + seconds?: (Long|null); + } + + /** + * A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [p] Properties to set + */ + constructor(p?: proto.IDuration); + + /** The number of seconds for this duration. */ + public seconds: Long; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: proto.IDuration): proto.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @param m Duration message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IDuration, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Duration; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FractionalFee. */ + interface IFractionalFee { + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + minimumAmount?: (Long|null); + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + maximumAmount?: (Long|null); + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + netOfTransfers?: (boolean|null); + } + + /** + * A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + */ + class FractionalFee implements IFractionalFee { + + /** + * Constructs a new FractionalFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFractionalFee); + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + */ + public fractionalAmount?: (proto.IFraction|null); + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + */ + public minimumAmount: Long; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + */ + public maximumAmount: Long; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + public netOfTransfers: boolean; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FractionalFee instance + */ + public static create(properties?: proto.IFractionalFee): proto.FractionalFee; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @param m FractionalFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFractionalFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FractionalFee; + + /** + * Gets the default type url for FractionalFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedFee. */ + interface IFixedFee { + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + denominatingTokenId?: (proto.ITokenID|null); + } + + /** + * A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + */ + class FixedFee implements IFixedFee { + + /** + * Constructs a new FixedFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedFee); + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + public denominatingTokenId?: (proto.ITokenID|null); + + /** + * Creates a new FixedFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedFee instance + */ + public static create(properties?: proto.IFixedFee): proto.FixedFee; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @param m FixedFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedFee; + + /** + * Gets the default type url for FixedFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoyaltyFee. */ + interface IRoyaltyFee { + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + fallbackFee?: (proto.IFixedFee|null); + } + + /** + * A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + */ + class RoyaltyFee implements IRoyaltyFee { + + /** + * Constructs a new RoyaltyFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IRoyaltyFee); + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + */ + public exchangeValueFraction?: (proto.IFraction|null); + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + public fallbackFee?: (proto.IFixedFee|null); + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @param [properties] Properties to set + * @returns RoyaltyFee instance + */ + public static create(properties?: proto.IRoyaltyFee): proto.RoyaltyFee; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @param m RoyaltyFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IRoyaltyFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.RoyaltyFee; + + /** + * Gets the default type url for RoyaltyFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFee. */ + interface ICustomFee { + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + allCollectorsAreExempt?: (boolean|null); + } + + /** + * A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + */ + class CustomFee implements ICustomFee { + + /** + * Constructs a new CustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFee); + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + */ + public fractionalFee?: (proto.IFractionalFee|null); + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + */ + public royaltyFee?: (proto.IRoyaltyFee|null); + + /** The account to receive the custom fee. */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + public allCollectorsAreExempt: boolean; + + /** CustomFee fee. */ + public fee?: ("fixedFee"|"fractionalFee"|"royaltyFee"); + + /** + * Creates a new CustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFee instance + */ + public static create(properties?: proto.ICustomFee): proto.CustomFee; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @param m CustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFee; + + /** + * Gets the default type url for CustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssessedCustomFee. */ + interface IAssessedCustomFee { + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + amount?: (Long|null); + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + effectivePayerAccountId?: (proto.IAccountID[]|null); + } + + /** + * Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + */ + class AssessedCustomFee implements IAssessedCustomFee { + + /** + * Constructs a new AssessedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IAssessedCustomFee); + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + */ + public amount: Long; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + */ + public tokenId?: (proto.ITokenID|null); + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + public effectivePayerAccountId: proto.IAccountID[]; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AssessedCustomFee instance + */ + public static create(properties?: proto.IAssessedCustomFee): proto.AssessedCustomFee; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @param m AssessedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IAssessedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.AssessedCustomFee; + + /** + * Gets the default type url for AssessedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFee. */ + interface IFixedCustomFee { + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + feeCollectorAccountId?: (proto.IAccountID|null); + } + + /** + * A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + */ + class FixedCustomFee implements IFixedCustomFee { + + /** + * Constructs a new FixedCustomFee. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFee); + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + */ + public fixedFee?: (proto.IFixedFee|null); + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + public feeCollectorAccountId?: (proto.IAccountID|null); + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFee instance + */ + public static create(properties?: proto.IFixedCustomFee): proto.FixedCustomFee; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @param m FixedCustomFee message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFee, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFee; + + /** + * Gets the default type url for FixedCustomFee + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FixedCustomFeeList. */ + interface IFixedCustomFeeList { + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + fees?: (proto.IFixedCustomFee[]|null); + } + + /** + * A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + */ + class FixedCustomFeeList implements IFixedCustomFeeList { + + /** + * Constructs a new FixedCustomFeeList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFixedCustomFeeList); + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + public fees: proto.IFixedCustomFee[]; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedCustomFeeList instance + */ + public static create(properties?: proto.IFixedCustomFeeList): proto.FixedCustomFeeList; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @param m FixedCustomFeeList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFixedCustomFeeList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FixedCustomFeeList; + + /** + * Gets the default type url for FixedCustomFeeList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeeExemptKeyList. */ + interface IFeeExemptKeyList { + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + keys?: (proto.IKey[]|null); + } + + /** + * A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + */ + class FeeExemptKeyList implements IFeeExemptKeyList { + + /** + * Constructs a new FeeExemptKeyList. + * @param [p] Properties to set + */ + constructor(p?: proto.IFeeExemptKeyList); + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + public keys: proto.IKey[]; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FeeExemptKeyList instance + */ + public static create(properties?: proto.IFeeExemptKeyList): proto.FeeExemptKeyList; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @param m FeeExemptKeyList message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.IFeeExemptKeyList, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.FeeExemptKeyList; + + /** + * Gets the default type url for FeeExemptKeyList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomFeeLimit. */ + interface ICustomFeeLimit { + + /** A payer account identifier. */ + accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + fees?: (proto.IFixedFee[]|null); + } + + /** + * A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + */ + class CustomFeeLimit implements ICustomFeeLimit { + + /** + * Constructs a new CustomFeeLimit. + * @param [p] Properties to set + */ + constructor(p?: proto.ICustomFeeLimit); + + /** A payer account identifier. */ + public accountId?: (proto.IAccountID|null); + + /** The maximum fees that the user is willing to pay for the message. */ + public fees: proto.IFixedFee[]; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomFeeLimit instance + */ + public static create(properties?: proto.ICustomFeeLimit): proto.CustomFeeLimit; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @param m CustomFeeLimit message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ICustomFeeLimit, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.CustomFeeLimit; + + /** + * Gets the default type url for CustomFeeLimit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + nanos?: (number|null); + } + + /** + * An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestamp); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: proto.ITimestamp): proto.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @param m Timestamp message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestamp, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.Timestamp; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimestampSeconds. */ + interface ITimestampSeconds { + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + seconds?: (Long|null); + } + + /** An exact date and time, with a resolution of one second. */ + class TimestampSeconds implements ITimestampSeconds { + + /** + * Constructs a new TimestampSeconds. + * @param [p] Properties to set + */ + constructor(p?: proto.ITimestampSeconds); + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + public seconds: Long; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampSeconds instance + */ + public static create(properties?: proto.ITimestampSeconds): proto.TimestampSeconds; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @param m TimestampSeconds message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: proto.ITimestampSeconds, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): proto.TimestampSeconds; + + /** + * Gets the default type url for TimestampSeconds + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace google. */ + namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** The uint32 value. */ + value?: (number|null); + } + + /** Wrapper message for `uint32`. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt32Value); + + /** The uint32 value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param m UInt32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt32Value; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** The string value. */ + value?: (string|null); + } + + /** Wrapper message for `string`. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IStringValue); + + /** The string value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param m StringValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IStringValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.StringValue; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** The bool value. */ + value?: (boolean|null); + } + + /** Wrapper message for `bool`. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBoolValue); + + /** The bool value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param m BoolValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBoolValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BoolValue; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** The bytes value. */ + value?: (Uint8Array|null); + } + + /** Wrapper message for `bytes`. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IBytesValue); + + /** The bytes value. */ + public value: Uint8Array; + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param m BytesValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IBytesValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.BytesValue; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** The uint64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `uint64`. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IUInt64Value); + + /** The uint64 value. */ + public value: Long; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param m UInt64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IUInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.UInt64Value; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** The int32 value. */ + value?: (number|null); + } + + /** Wrapper message for `int32`. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt32Value); + + /** The int32 value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param m Int32Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt32Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int32Value; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** The int64 value. */ + value?: (Long|null); + } + + /** Wrapper message for `int64`. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IInt64Value); + + /** The int64 value. */ + public value: Long; + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param m Int64Value message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IInt64Value, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.Int64Value; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** The float value. */ + value?: (number|null); + } + + /** Wrapper message for `float`. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IFloatValue); + + /** The float value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param m FloatValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IFloatValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.FloatValue; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** The double value. */ + value?: (number|null); + } + + /** Wrapper message for `double`. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [p] Properties to set + */ + constructor(p?: google.protobuf.IDoubleValue); + + /** The double value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param m DoubleValue message or plain object to encode + * @param [w] Writer to encode to + * @returns Writer + */ + public static encode(m: google.protobuf.IDoubleValue, w?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param r Reader or buffer to decode from + * @param [l] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): google.protobuf.DoubleValue; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } +} diff --git a/packages/proto/src/minimal/util_prng_transaction.js b/packages/proto/src/minimal/util_prng_transaction.js new file mode 100644 index 0000000000..74bfdf511a --- /dev/null +++ b/packages/proto/src/minimal/util_prng_transaction.js @@ -0,0 +1,11117 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots.hashgraph_util_prng_transaction || ($protobuf.roots.hashgraph_util_prng_transaction = {}); + +export const proto = $root.proto = (() => { + + /** + * Namespace proto. + * @exports proto + * @namespace + */ + const proto = {}; + + proto.Transaction = (function() { + + /** + * Properties of a Transaction. + * @memberof proto + * @interface ITransaction + * @property {Uint8Array|null} [signedTransactionBytes] A valid, serialized, `SignedTransaction` message. + */ + + /** + * Constructs a new Transaction. + * @memberof proto + * @classdesc A wrapper around signed transaction bytes for utility PRNG. + * @implements ITransaction + * @constructor + * @param {proto.ITransaction=} [p] Properties to set + */ + function Transaction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A valid, serialized, `SignedTransaction` message. + * @member {Uint8Array} signedTransactionBytes + * @memberof proto.Transaction + * @instance + */ + Transaction.prototype.signedTransactionBytes = $util.newBuffer([]); + + /** + * Creates a new Transaction instance using the specified properties. + * @function create + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction=} [properties] Properties to set + * @returns {proto.Transaction} Transaction instance + */ + Transaction.create = function create(properties) { + return new Transaction(properties); + }; + + /** + * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. + * @function encode + * @memberof proto.Transaction + * @static + * @param {proto.ITransaction} m Transaction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Transaction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.signedTransactionBytes != null && Object.hasOwnProperty.call(m, "signedTransactionBytes")) + w.uint32(42).bytes(m.signedTransactionBytes); + return w; + }; + + /** + * Decodes a Transaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Transaction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Transaction} Transaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Transaction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Transaction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 5: { + m.signedTransactionBytes = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Transaction + * @function getTypeUrl + * @memberof proto.Transaction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Transaction"; + }; + + return Transaction; + })(); + + proto.UtilPrngTransactionBody = (function() { + + /** + * Properties of an UtilPrngTransactionBody. + * @memberof proto + * @interface IUtilPrngTransactionBody + * @property {number|null} [range] A range for the requested value. + */ + + /** + * Constructs a new UtilPrngTransactionBody. + * @memberof proto + * @classdesc Request a deterministic pseudo-random number. + * @implements IUtilPrngTransactionBody + * @constructor + * @param {proto.IUtilPrngTransactionBody=} [p] Properties to set + */ + function UtilPrngTransactionBody(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A range for the requested value. + * @member {number} range + * @memberof proto.UtilPrngTransactionBody + * @instance + */ + UtilPrngTransactionBody.prototype.range = 0; + + /** + * Creates a new UtilPrngTransactionBody instance using the specified properties. + * @function create + * @memberof proto.UtilPrngTransactionBody + * @static + * @param {proto.IUtilPrngTransactionBody=} [properties] Properties to set + * @returns {proto.UtilPrngTransactionBody} UtilPrngTransactionBody instance + */ + UtilPrngTransactionBody.create = function create(properties) { + return new UtilPrngTransactionBody(properties); + }; + + /** + * Encodes the specified UtilPrngTransactionBody message. Does not implicitly {@link proto.UtilPrngTransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.UtilPrngTransactionBody + * @static + * @param {proto.IUtilPrngTransactionBody} m UtilPrngTransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UtilPrngTransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.range != null && Object.hasOwnProperty.call(m, "range")) + w.uint32(8).int32(m.range); + return w; + }; + + /** + * Decodes an UtilPrngTransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.UtilPrngTransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.UtilPrngTransactionBody} UtilPrngTransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UtilPrngTransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.UtilPrngTransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.range = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UtilPrngTransactionBody + * @function getTypeUrl + * @memberof proto.UtilPrngTransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UtilPrngTransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.UtilPrngTransactionBody"; + }; + + return UtilPrngTransactionBody; + })(); + + proto.TransactionBody = (function() { + + /** + * Properties of a TransactionBody. + * @memberof proto + * @interface ITransactionBody + * @property {proto.ITransactionID|null} [transactionID] A transaction identifier. + * @property {proto.IAccountID|null} [nodeAccountID] A node account identifier. + * @property {Long|null} [transactionFee] A maximum transaction fee, in tinybar. + * @property {proto.IDuration|null} [transactionValidDuration] A maximum duration in which to execute this transaction. + * @property {string|null} [memo] A short description for this transaction. + * @property {proto.IKey|null} [batchKey] The public key of the trusted batch assembler. + * @property {proto.IUtilPrngTransactionBody|null} [utilPrng] Provide a deterministic pseudorandom number. + * @property {Array.|null} [maxCustomFees] A list of maximum custom fees that the users are willing to pay. + */ + + /** + * Constructs a new TransactionBody. + * @memberof proto + * @classdesc A transaction body for utility PRNG. + * @implements ITransactionBody + * @constructor + * @param {proto.ITransactionBody=} [p] Properties to set + */ + function TransactionBody(p) { + this.maxCustomFees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction identifier. + * @member {proto.ITransactionID|null|undefined} transactionID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionID = null; + + /** + * A node account identifier. + * @member {proto.IAccountID|null|undefined} nodeAccountID + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.nodeAccountID = null; + + /** + * A maximum transaction fee, in tinybar. + * @member {Long} transactionFee + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A maximum duration in which to execute this transaction. + * @member {proto.IDuration|null|undefined} transactionValidDuration + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.transactionValidDuration = null; + + /** + * A short description for this transaction. + * @member {string} memo + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.memo = ""; + + /** + * The public key of the trusted batch assembler. + * @member {proto.IKey|null|undefined} batchKey + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.batchKey = null; + + /** + * Provide a deterministic pseudorandom number. + * @member {proto.IUtilPrngTransactionBody|null|undefined} utilPrng + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.utilPrng = null; + + /** + * A list of maximum custom fees that the users are willing to pay. + * @member {Array.} maxCustomFees + * @memberof proto.TransactionBody + * @instance + */ + TransactionBody.prototype.maxCustomFees = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * TransactionBody data. + * @member {"utilPrng"|undefined} data + * @memberof proto.TransactionBody + * @instance + */ + Object.defineProperty(TransactionBody.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["utilPrng"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionBody instance using the specified properties. + * @function create + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody=} [properties] Properties to set + * @returns {proto.TransactionBody} TransactionBody instance + */ + TransactionBody.create = function create(properties) { + return new TransactionBody(properties); + }; + + /** + * Encodes the specified TransactionBody message. Does not implicitly {@link proto.TransactionBody.verify|verify} messages. + * @function encode + * @memberof proto.TransactionBody + * @static + * @param {proto.ITransactionBody} m TransactionBody message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionBody.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionID != null && Object.hasOwnProperty.call(m, "transactionID")) + $root.proto.TransactionID.encode(m.transactionID, w.uint32(10).fork()).ldelim(); + if (m.nodeAccountID != null && Object.hasOwnProperty.call(m, "nodeAccountID")) + $root.proto.AccountID.encode(m.nodeAccountID, w.uint32(18).fork()).ldelim(); + if (m.transactionFee != null && Object.hasOwnProperty.call(m, "transactionFee")) + w.uint32(24).uint64(m.transactionFee); + if (m.transactionValidDuration != null && Object.hasOwnProperty.call(m, "transactionValidDuration")) + $root.proto.Duration.encode(m.transactionValidDuration, w.uint32(34).fork()).ldelim(); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(50).string(m.memo); + if (m.utilPrng != null && Object.hasOwnProperty.call(m, "utilPrng")) + $root.proto.UtilPrngTransactionBody.encode(m.utilPrng, w.uint32(418).fork()).ldelim(); + if (m.batchKey != null && Object.hasOwnProperty.call(m, "batchKey")) + $root.proto.Key.encode(m.batchKey, w.uint32(586).fork()).ldelim(); + if (m.maxCustomFees != null && m.maxCustomFees.length) { + for (var i = 0; i < m.maxCustomFees.length; ++i) + $root.proto.CustomFeeLimit.encode(m.maxCustomFees[i], w.uint32(8010).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionBody message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionBody + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionBody} TransactionBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionBody.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionBody(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionID = $root.proto.TransactionID.decode(r, r.uint32()); + break; + } + case 2: { + m.nodeAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.transactionFee = r.uint64(); + break; + } + case 4: { + m.transactionValidDuration = $root.proto.Duration.decode(r, r.uint32()); + break; + } + case 6: { + m.memo = r.string(); + break; + } + case 73: { + m.batchKey = $root.proto.Key.decode(r, r.uint32()); + break; + } + case 52: { + m.utilPrng = $root.proto.UtilPrngTransactionBody.decode(r, r.uint32()); + break; + } + case 1001: { + if (!(m.maxCustomFees && m.maxCustomFees.length)) + m.maxCustomFees = []; + m.maxCustomFees.push($root.proto.CustomFeeLimit.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionBody + * @function getTypeUrl + * @memberof proto.TransactionBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionBody"; + }; + + return TransactionBody; + })(); + + proto.TransactionList = (function() { + + /** + * Properties of a TransactionList. + * @memberof proto + * @interface ITransactionList + * @property {Array.|null} [transactionList] TransactionList transactionList + */ + + /** + * Constructs a new TransactionList. + * @memberof proto + * @classdesc Represents a TransactionList. + * @implements ITransactionList + * @constructor + * @param {proto.ITransactionList=} [p] Properties to set + */ + function TransactionList(p) { + this.transactionList = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * TransactionList transactionList. + * @member {Array.} transactionList + * @memberof proto.TransactionList + * @instance + */ + TransactionList.prototype.transactionList = $util.emptyArray; + + /** + * Creates a new TransactionList instance using the specified properties. + * @function create + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList=} [properties] Properties to set + * @returns {proto.TransactionList} TransactionList instance + */ + TransactionList.create = function create(properties) { + return new TransactionList(properties); + }; + + /** + * Encodes the specified TransactionList message. Does not implicitly {@link proto.TransactionList.verify|verify} messages. + * @function encode + * @memberof proto.TransactionList + * @static + * @param {proto.ITransactionList} m TransactionList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionList != null && m.transactionList.length) { + for (var i = 0; i < m.transactionList.length; ++i) + $root.proto.Transaction.encode(m.transactionList[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionList} TransactionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionList && m.transactionList.length)) + m.transactionList = []; + m.transactionList.push($root.proto.Transaction.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionList + * @function getTypeUrl + * @memberof proto.TransactionList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionList"; + }; + + return TransactionList; + })(); + + proto.ShardID = (function() { + + /** + * Properties of a ShardID. + * @memberof proto + * @interface IShardID + * @property {Long|null} [shardNum] A whole number shard identifier. + */ + + /** + * Constructs a new ShardID. + * @memberof proto + * @classdesc A shard identifier.
+ * A shard is a partition of nodes running the network that processes + * transactions separately from other shards. Each shard is effectively an + * independent instance of the overall network that shares the same virtual + * distributed ledger, and may gossip cross-shard transactions with other + * shards to maintain overall correct processing of the ledger. + * @implements IShardID + * @constructor + * @param {proto.IShardID=} [p] Properties to set + */ + function ShardID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ShardID + * @instance + */ + ShardID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ShardID instance using the specified properties. + * @function create + * @memberof proto.ShardID + * @static + * @param {proto.IShardID=} [properties] Properties to set + * @returns {proto.ShardID} ShardID instance + */ + ShardID.create = function create(properties) { + return new ShardID(properties); + }; + + /** + * Encodes the specified ShardID message. Does not implicitly {@link proto.ShardID.verify|verify} messages. + * @function encode + * @memberof proto.ShardID + * @static + * @param {proto.IShardID} m ShardID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShardID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + return w; + }; + + /** + * Decodes a ShardID message from the specified reader or buffer. + * @function decode + * @memberof proto.ShardID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ShardID} ShardID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShardID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ShardID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ShardID + * @function getTypeUrl + * @memberof proto.ShardID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShardID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ShardID"; + }; + + return ShardID; + })(); + + proto.RealmID = (function() { + + /** + * Properties of a RealmID. + * @memberof proto + * @interface IRealmID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + */ + + /** + * Constructs a new RealmID. + * @memberof proto + * @classdesc A realm identifier.
+ * Within a given shard, every realm has a unique numeric identifier. + * Each account, file, and contract instance belongs to exactly one realm. + * @implements IRealmID + * @constructor + * @param {proto.IRealmID=} [p] Properties to set + */ + function RealmID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.RealmID + * @instance + */ + RealmID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new RealmID instance using the specified properties. + * @function create + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID=} [properties] Properties to set + * @returns {proto.RealmID} RealmID instance + */ + RealmID.create = function create(properties) { + return new RealmID(properties); + }; + + /** + * Encodes the specified RealmID message. Does not implicitly {@link proto.RealmID.verify|verify} messages. + * @function encode + * @memberof proto.RealmID + * @static + * @param {proto.IRealmID} m RealmID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + return w; + }; + + /** + * Decodes a RealmID message from the specified reader or buffer. + * @function decode + * @memberof proto.RealmID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RealmID} RealmID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RealmID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RealmID + * @function getTypeUrl + * @memberof proto.RealmID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RealmID"; + }; + + return RealmID; + })(); + + proto.TokenID = (function() { + + /** + * Properties of a TokenID. + * @memberof proto + * @interface ITokenID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [tokenNum] A whole number token identifier. + */ + + /** + * Constructs a new TokenID. + * @memberof proto + * @classdesc Unique identifier for a token.
+ * As with all entity identifiers within the network, a token identifier + * consists of a combination of shard number, realm number, and entity number. + * Each of these numbers is unique within its scope (shard > realm > entity). + * @implements ITokenID + * @constructor + * @param {proto.ITokenID=} [p] Properties to set + */ + function TokenID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number token identifier. + * @member {Long} tokenNum + * @memberof proto.TokenID + * @instance + */ + TokenID.prototype.tokenNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TokenID instance using the specified properties. + * @function create + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID=} [properties] Properties to set + * @returns {proto.TokenID} TokenID instance + */ + TokenID.create = function create(properties) { + return new TokenID(properties); + }; + + /** + * Encodes the specified TokenID message. Does not implicitly {@link proto.TokenID.verify|verify} messages. + * @function encode + * @memberof proto.TokenID + * @static + * @param {proto.ITokenID} m TokenID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.tokenNum != null && Object.hasOwnProperty.call(m, "tokenNum")) + w.uint32(24).int64(m.tokenNum); + return w; + }; + + /** + * Decodes a TokenID message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenID} TokenID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.tokenNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenID + * @function getTypeUrl + * @memberof proto.TokenID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenID"; + }; + + return TokenID; + })(); + + /** + * A specific hash algorithm. + * + * We did not reuse Record Stream `HashAlgorithm` here because in all cases, + * currently, this will be `SHA2_384` and if that is the default value then + * we can save space by not serializing it, whereas `HASH_ALGORITHM_UNKNOWN` + * is the default for Record Stream `HashAlgorithm`. + * + * Note that enum values here MUST NOT match the name of any other enum value + * in the same `package`, as protobuf follows `C++` scope rules and all enum + * _names_ are treated as global constants within the `package`. + * @name proto.BlockHashAlgorithm + * @enum {number} + * @property {number} SHA2_384=0 A SHA2 algorithm SHA-384 hash. + *

+ * This is the default value, if a field of this enumerated type is + * not set, then this is the value that will be decoded when the + * serialized message is read. + */ + proto.BlockHashAlgorithm = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHA2_384"] = 0; + return values; + })(); + + proto.AccountID = (function() { + + /** + * Properties of an AccountID. + * @memberof proto + * @interface IAccountID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [accountNum] A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @property {Uint8Array|null} [alias] An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + */ + + /** + * Constructs a new AccountID. + * @memberof proto + * @classdesc A unique identifier for an Hedera account. + * + * An account identifier is of the form `shard.realm.[number|alias]`.
+ * The identifier MAY use the alias form when transferring HBAR to a public key + * before the account for that key is created, when only the alias value is + * known, or in some smart contracts that use the EVM address style alias to + * refer to Accounts.
+ * When the account entry is completed, the alias SHALL be stored separately in + * the Account record, and the identifier in the Account SHALL use the + * `accountNum` form. + * + * --- + * ### Additional Notes + * + * #### Alias + * There is considerable complexity with `alias` (aka `evm_address`) for + * Accounts. Much of this comes from the existence of a "hidden" alias for + * almost all accounts, and the reuse of the alias field for both EVM reference + * and "automatic" account creation.
+ * For the purposes of this specification, we will use the following terms for + * clarity. + * - `key_alias`
+ * The account public key as a protobuf serialized message and used for + * auto-creation and subsequent lookup. This is only valid if the account + * key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. + * - `evm_address`
+ * Exists for every account and is one of + * - `contract_address`
+ * The 20 byte EVM address prescribed by `CREATE` or `CREATE2` + * - `evm_key_address`
+ * An arbitrary 20 byte EVM address that, for a usable externally owned + * account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash + * of a ECDSA_SECP256K1 key.
+ * Such accounts may be created in one of three ways: + * - Sending hbar or fungible tokens to an unused + * ECDSA_SECP256K1 key alias. + * - Sending hbar or fungible tokens to an unassigned 20-byte + * EVM address. + * - Submitting a `CryptoCreate` signed with the corresponding + * private key. + * - `long_zero`
+ * A synthetic 20 byte address inferred for "normally" created accounts. + * It is constructed from the "standard" AccountID as follows. + * 1. 4 byte big-endian shard number + * 1. 8 byte big-endian realm number + * 1. 8 byte big-endian entity number
+ * + * The `alias` field in the `Account` message SHALL contain one of four values + * for any given account. + * - The `key_alias`, if the account was created by transferring HBAR to the + * `key_alias` public key value. + * - The `evm_key_address` if the account was created from an EVM public key + * - The `contract_address` if the account belongs to an EVM contract + * - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was + * created normally + * + * If the `alias` field of an `Account` is any form of `null`, then the account + * MAY be referred to by `alias` in an `AccountID` by using the `long_zero` + * address for the account.
+ * This "hidden default" alias SHALL NOT be stored, but is synthesized by the + * node software as needed, and may be synthesized by an EVM contract or client + * software as well. + * + * --- + * + * #### Alias forms + * An `AccountID` in a transaction MAY reference an `Account` with + * `shard.realm.alias`.
+ * If the account `alias` field is set for an Account, that value SHALL be the + * account alias.
+ * If the account `alias` field is not set for an Account, the `long_zero` alias + * SHALL be the account alias. + * @implements IAccountID + * @constructor + * @param {proto.IAccountID=} [p] Properties to set + */ + function AccountID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number account number, unique within its realm and shard. + *

+ * For any AccountID fields in the query response, transaction records, + * transaction receipts, or block stream `accountNum` MUST be used. + * @member {Long|null|undefined} accountNum + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.accountNum = null; + + /** + * An alias value.
+ * Alias is a value used in some contexts to refer to an account when + * account number is not available, and may be an alias public key, or + * an EVM address. + * @member {Uint8Array|null|undefined} alias + * @memberof proto.AccountID + * @instance + */ + AccountID.prototype.alias = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * AccountID account. + * @member {"accountNum"|"alias"|undefined} account + * @memberof proto.AccountID + * @instance + */ + Object.defineProperty(AccountID.prototype, "account", { + get: $util.oneOfGetter($oneOfFields = ["accountNum", "alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccountID instance using the specified properties. + * @function create + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID=} [properties] Properties to set + * @returns {proto.AccountID} AccountID instance + */ + AccountID.create = function create(properties) { + return new AccountID(properties); + }; + + /** + * Encodes the specified AccountID message. Does not implicitly {@link proto.AccountID.verify|verify} messages. + * @function encode + * @memberof proto.AccountID + * @static + * @param {proto.IAccountID} m AccountID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.accountNum != null && Object.hasOwnProperty.call(m, "accountNum")) + w.uint32(24).int64(m.accountNum); + if (m.alias != null && Object.hasOwnProperty.call(m, "alias")) + w.uint32(34).bytes(m.alias); + return w; + }; + + /** + * Decodes an AccountID message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountID} AccountID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.accountNum = r.int64(); + break; + } + case 4: { + m.alias = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountID + * @function getTypeUrl + * @memberof proto.AccountID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountID"; + }; + + return AccountID; + })(); + + proto.NftID = (function() { + + /** + * Properties of a NftID. + * @memberof proto + * @interface INftID + * @property {proto.ITokenID|null} [token_ID] A token identifier.
+ * This token represents the collection containing this NFT. + * @property {Long|null} [serialNumber] A unique serial number.
+ * This serial number is unique within its token type. + */ + + /** + * Constructs a new NftID. + * @memberof proto + * @classdesc An identifier for a unique token (or "NFT"), used by both contract + * and token services. + * @implements INftID + * @constructor + * @param {proto.INftID=} [p] Properties to set + */ + function NftID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This token represents the collection containing this NFT. + * @member {proto.ITokenID|null|undefined} token_ID + * @memberof proto.NftID + * @instance + */ + NftID.prototype.token_ID = null; + + /** + * A unique serial number.
+ * This serial number is unique within its token type. + * @member {Long} serialNumber + * @memberof proto.NftID + * @instance + */ + NftID.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NftID instance using the specified properties. + * @function create + * @memberof proto.NftID + * @static + * @param {proto.INftID=} [properties] Properties to set + * @returns {proto.NftID} NftID instance + */ + NftID.create = function create(properties) { + return new NftID(properties); + }; + + /** + * Encodes the specified NftID message. Does not implicitly {@link proto.NftID.verify|verify} messages. + * @function encode + * @memberof proto.NftID + * @static + * @param {proto.INftID} m NftID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token_ID != null && Object.hasOwnProperty.call(m, "token_ID")) + $root.proto.TokenID.encode(m.token_ID, w.uint32(10).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(16).int64(m.serialNumber); + return w; + }; + + /** + * Decodes a NftID message from the specified reader or buffer. + * @function decode + * @memberof proto.NftID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftID} NftID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token_ID = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.serialNumber = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftID + * @function getTypeUrl + * @memberof proto.NftID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftID"; + }; + + return NftID; + })(); + + proto.FileID = (function() { + + /** + * Properties of a FileID. + * @memberof proto + * @interface IFileID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [fileNum] A whole number file identifier, unique within its realm and shard. + */ + + /** + * Constructs a new FileID. + * @memberof proto + * @classdesc An identifier for a File within the network. + * @implements IFileID + * @constructor + * @param {proto.IFileID=} [p] Properties to set + */ + function FileID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number file identifier, unique within its realm and shard. + * @member {Long} fileNum + * @memberof proto.FileID + * @instance + */ + FileID.prototype.fileNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FileID instance using the specified properties. + * @function create + * @memberof proto.FileID + * @static + * @param {proto.IFileID=} [properties] Properties to set + * @returns {proto.FileID} FileID instance + */ + FileID.create = function create(properties) { + return new FileID(properties); + }; + + /** + * Encodes the specified FileID message. Does not implicitly {@link proto.FileID.verify|verify} messages. + * @function encode + * @memberof proto.FileID + * @static + * @param {proto.IFileID} m FileID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.fileNum != null && Object.hasOwnProperty.call(m, "fileNum")) + w.uint32(24).int64(m.fileNum); + return w; + }; + + /** + * Decodes a FileID message from the specified reader or buffer. + * @function decode + * @memberof proto.FileID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FileID} FileID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FileID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.fileNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FileID + * @function getTypeUrl + * @memberof proto.FileID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FileID"; + }; + + return FileID; + })(); + + proto.ContractID = (function() { + + /** + * Properties of a ContractID. + * @memberof proto + * @interface IContractID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [contractNum] A whole number contract identifier, unique within its realm and shard. + * @property {Uint8Array|null} [evmAddress] A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + */ + + /** + * Constructs a new ContractID. + * @memberof proto + * @classdesc An identifier for a smart contract within the network. + * @implements IContractID + * @constructor + * @param {proto.IContractID=} [p] Properties to set + */ + function ContractID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number contract identifier, unique within its realm and shard. + * @member {Long|null|undefined} contractNum + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.contractNum = null; + + /** + * A 20-byte EVM address of the contract to call. + *

+ * A contract created via a HAPI `ContractCreate` call SHALL have + * an EVM address determined by its `shard.realm.num` identifier.
+ * This address is as follows + *

    + *
  1. 4 byte big-endian shard number
  2. + *
  3. 8 byte big-endian realm number
  4. + *
  5. 8 byte big-endian contract number
  6. + *
+ * This address is not stored in state, but is computed when needed. + *

+ * Contracts created by any other means, including a HAPI + * `EthereumTransaction` whose `to` address is the zero address, + * SHALL have the EVM address prescribed by the `CREATE` or + * `CREATE2` opcode, as applicable. + * @member {Uint8Array|null|undefined} evmAddress + * @memberof proto.ContractID + * @instance + */ + ContractID.prototype.evmAddress = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ContractID contract. + * @member {"contractNum"|"evmAddress"|undefined} contract + * @memberof proto.ContractID + * @instance + */ + Object.defineProperty(ContractID.prototype, "contract", { + get: $util.oneOfGetter($oneOfFields = ["contractNum", "evmAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContractID instance using the specified properties. + * @function create + * @memberof proto.ContractID + * @static + * @param {proto.IContractID=} [properties] Properties to set + * @returns {proto.ContractID} ContractID instance + */ + ContractID.create = function create(properties) { + return new ContractID(properties); + }; + + /** + * Encodes the specified ContractID message. Does not implicitly {@link proto.ContractID.verify|verify} messages. + * @function encode + * @memberof proto.ContractID + * @static + * @param {proto.IContractID} m ContractID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContractID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.contractNum != null && Object.hasOwnProperty.call(m, "contractNum")) + w.uint32(24).int64(m.contractNum); + if (m.evmAddress != null && Object.hasOwnProperty.call(m, "evmAddress")) + w.uint32(34).bytes(m.evmAddress); + return w; + }; + + /** + * Decodes a ContractID message from the specified reader or buffer. + * @function decode + * @memberof proto.ContractID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ContractID} ContractID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContractID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ContractID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.contractNum = r.int64(); + break; + } + case 4: { + m.evmAddress = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ContractID + * @function getTypeUrl + * @memberof proto.ContractID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContractID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ContractID"; + }; + + return ContractID; + })(); + + proto.TopicID = (function() { + + /** + * Properties of a TopicID. + * @memberof proto + * @interface ITopicID + * @property {Long|null} [shardNum] A whole number shard identifier. + * @property {Long|null} [realmNum] A whole number realm identifier. + * @property {Long|null} [topicNum] A whole number topic identifier, unique within its realm and shard. + */ + + /** + * Constructs a new TopicID. + * @memberof proto + * @classdesc An unique identifier for a topic.
+ * Topics are part of the consensus service, messages are published to a topic. + * @implements ITopicID + * @constructor + * @param {proto.ITopicID=} [p] Properties to set + */ + function TopicID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard identifier. + * @member {Long} shardNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm identifier. + * @member {Long} realmNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number topic identifier, unique within its realm and shard. + * @member {Long} topicNum + * @memberof proto.TopicID + * @instance + */ + TopicID.prototype.topicNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TopicID instance using the specified properties. + * @function create + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID=} [properties] Properties to set + * @returns {proto.TopicID} TopicID instance + */ + TopicID.create = function create(properties) { + return new TopicID(properties); + }; + + /** + * Encodes the specified TopicID message. Does not implicitly {@link proto.TopicID.verify|verify} messages. + * @function encode + * @memberof proto.TopicID + * @static + * @param {proto.ITopicID} m TopicID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopicID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.topicNum != null && Object.hasOwnProperty.call(m, "topicNum")) + w.uint32(24).int64(m.topicNum); + return w; + }; + + /** + * Decodes a TopicID message from the specified reader or buffer. + * @function decode + * @memberof proto.TopicID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TopicID} TopicID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopicID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TopicID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.topicNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TopicID + * @function getTypeUrl + * @memberof proto.TopicID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopicID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TopicID"; + }; + + return TopicID; + })(); + + proto.ScheduleID = (function() { + + /** + * Properties of a ScheduleID. + * @memberof proto + * @interface IScheduleID + * @property {Long|null} [shardNum] A whole number shard + * @property {Long|null} [realmNum] A whole number realm + * @property {Long|null} [scheduleNum] A whole number schedule, unique within its realm and shard + */ + + /** + * Constructs a new ScheduleID. + * @memberof proto + * @classdesc An unique identifier for a Schedule + * @implements IScheduleID + * @constructor + * @param {proto.IScheduleID=} [p] Properties to set + */ + function ScheduleID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A whole number shard + * @member {Long} shardNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.shardNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number realm + * @member {Long} realmNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.realmNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A whole number schedule, unique within its realm and shard + * @member {Long} scheduleNum + * @memberof proto.ScheduleID + * @instance + */ + ScheduleID.prototype.scheduleNum = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ScheduleID instance using the specified properties. + * @function create + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID=} [properties] Properties to set + * @returns {proto.ScheduleID} ScheduleID instance + */ + ScheduleID.create = function create(properties) { + return new ScheduleID(properties); + }; + + /** + * Encodes the specified ScheduleID message. Does not implicitly {@link proto.ScheduleID.verify|verify} messages. + * @function encode + * @memberof proto.ScheduleID + * @static + * @param {proto.IScheduleID} m ScheduleID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.shardNum != null && Object.hasOwnProperty.call(m, "shardNum")) + w.uint32(8).int64(m.shardNum); + if (m.realmNum != null && Object.hasOwnProperty.call(m, "realmNum")) + w.uint32(16).int64(m.realmNum); + if (m.scheduleNum != null && Object.hasOwnProperty.call(m, "scheduleNum")) + w.uint32(24).int64(m.scheduleNum); + return w; + }; + + /** + * Decodes a ScheduleID message from the specified reader or buffer. + * @function decode + * @memberof proto.ScheduleID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ScheduleID} ScheduleID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ScheduleID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.shardNum = r.int64(); + break; + } + case 2: { + m.realmNum = r.int64(); + break; + } + case 3: { + m.scheduleNum = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ScheduleID + * @function getTypeUrl + * @memberof proto.ScheduleID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ScheduleID"; + }; + + return ScheduleID; + })(); + + proto.TransactionID = (function() { + + /** + * Properties of a TransactionID. + * @memberof proto + * @interface ITransactionID + * @property {proto.ITimestamp|null} [transactionValidStart] A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @property {proto.IAccountID|null} [accountID] An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @property {boolean|null} [scheduled] A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @property {number|null} [nonce] An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + */ + + /** + * Constructs a new TransactionID. + * @memberof proto + * @classdesc A transaction identifier.
+ * This is used for retrieving receipts and records for a transaction + * and internally by the network for detecting when duplicate transactions are + * submitted. + * + * A transaction may be processed more reliably by submitting it to + * several 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 SHALL NOT be executed (and SHALL result in a + * `DUPLICATE_TRANSACTION` response).
+ * Multiple submission increase reliability on the assumption that an error in, + * for example, network connectivity will not affect all nodes equally. Latency + * might be slightly lower, if one node is handling intake significantly slower + * than others, for example. The base transaction fee is required for each + * submission, however, so the total fees charged are significantly higher when + * using this approach. + * + * ### Requirements + * Each transaction identifier MUST be unique.
+ * Multiple transactions MAY be submitted with the same transaction + * identifier, but all except the first SHALL be rejected as duplicate + * transactions.
+ * An identifier MUST specify a `payer` account to be charged all fees + * associated with the transaction.
+ * The `payer` account MUST exist and MUST have sufficient HBAR to pay all + * transaction fees.
+ * An identifier MUST specify a "valid start time".
+ * The "valid start time" MUST be strictly _earlier_ than the current + * network consensus time when submitted.
+ * The "valid start time" MUST NOT be more than `transaction.maxValidDuration` + * seconds before the current network consensus time when submitted.
+ * A client-submitted transaction MUST NOT set the `scheduled` flag. + * + * ### Additional Notes + * + * Additional items applicable to Scheduled Transactions: + * + * - The ID of a Scheduled Transaction, once executed, SHALL inherit both + * `transactionValidStart` and `accountID` from the `ScheduleCreate` + * transaction that created the schedule. + * - The `scheduled` property SHALL be set for Scheduled Transactions. + * @implements ITransactionID + * @constructor + * @param {proto.ITransactionID=} [p] Properties to set + */ + function TransactionID(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A timestamp for the transaction start time.
+ * This is the earliest expected start time for this transaction. + *

+ * This value MUST be strictly less than `consensusTimestamp` when the + * transaction is submitted. + * @member {proto.ITimestamp|null|undefined} transactionValidStart + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.transactionValidStart = null; + + /** + * An Account identifier. + *

+ * The identified account SHALL pay transaction fees for this transaction. + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.accountID = null; + + /** + * A scheduled transaction flag.
+ * If set, this transaction represents the execution of a Schedule after + * all necessary signatures are gathered. + *

+ * This flag MUST NOT be set in a user-submitted transaction. + * @member {boolean} scheduled + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.scheduled = false; + + /** + * An identifier for an internal transaction.
+ * An internal transaction is one 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 transaction id with a + * different nonce. + *

+ * This value MUST be unset for user-submitted transactions. + * @member {number} nonce + * @memberof proto.TransactionID + * @instance + */ + TransactionID.prototype.nonce = 0; + + /** + * Creates a new TransactionID instance using the specified properties. + * @function create + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID=} [properties] Properties to set + * @returns {proto.TransactionID} TransactionID instance + */ + TransactionID.create = function create(properties) { + return new TransactionID(properties); + }; + + /** + * Encodes the specified TransactionID message. Does not implicitly {@link proto.TransactionID.verify|verify} messages. + * @function encode + * @memberof proto.TransactionID + * @static + * @param {proto.ITransactionID} m TransactionID message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionID.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionValidStart != null && Object.hasOwnProperty.call(m, "transactionValidStart")) + $root.proto.Timestamp.encode(m.transactionValidStart, w.uint32(10).fork()).ldelim(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(18).fork()).ldelim(); + if (m.scheduled != null && Object.hasOwnProperty.call(m, "scheduled")) + w.uint32(24).bool(m.scheduled); + if (m.nonce != null && Object.hasOwnProperty.call(m, "nonce")) + w.uint32(32).int32(m.nonce); + return w; + }; + + /** + * Decodes a TransactionID message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionID + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionID} TransactionID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionID.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionID(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.transactionValidStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 2: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.scheduled = r.bool(); + break; + } + case 4: { + m.nonce = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionID + * @function getTypeUrl + * @memberof proto.TransactionID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionID"; + }; + + return TransactionID; + })(); + + proto.AccountAmount = (function() { + + /** + * Properties of an AccountAmount. + * @memberof proto + * @interface IAccountAmount + * @property {proto.IAccountID|null} [accountID] An account identifier that will send or receive token(s). + * @property {Long|null} [amount] An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new AccountAmount. + * @memberof proto + * @classdesc An account, and the amount that it sends or receives during a token transfer. + * + * This message is only relevant to fungible/common token transfers. + * Non-fungible/unique (NFT) token transfers MUST use the NftTransfer message. + * @implements IAccountAmount + * @constructor + * @param {proto.IAccountAmount=} [p] Properties to set + */ + function AccountAmount(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An account identifier that will send or receive token(s). + * @member {proto.IAccountID|null|undefined} accountID + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.accountID = null; + + /** + * An amount to send (negative) or receive (positive). + *

+ * This amount MUST be denominated in the smallest unit of the relevant + * token.
+ * For HBAR this SHALL be tinybar (10-8 HBAR).
+ * For other fungible/common tokens this SHALL depend on the value of + * `decimals` for that token. + * @member {Long} amount + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `accountID` SHALL be the owner that previously approved + * the allowance.
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.AccountAmount + * @instance + */ + AccountAmount.prototype.isApproval = false; + + /** + * Creates a new AccountAmount instance using the specified properties. + * @function create + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount=} [properties] Properties to set + * @returns {proto.AccountAmount} AccountAmount instance + */ + AccountAmount.create = function create(properties) { + return new AccountAmount(properties); + }; + + /** + * Encodes the specified AccountAmount message. Does not implicitly {@link proto.AccountAmount.verify|verify} messages. + * @function encode + * @memberof proto.AccountAmount + * @static + * @param {proto.IAccountAmount} m AccountAmount message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccountAmount.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountID != null && Object.hasOwnProperty.call(m, "accountID")) + $root.proto.AccountID.encode(m.accountID, w.uint32(10).fork()).ldelim(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(16).sint64(m.amount); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(24).bool(m.isApproval); + return w; + }; + + /** + * Decodes an AccountAmount message from the specified reader or buffer. + * @function decode + * @memberof proto.AccountAmount + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AccountAmount} AccountAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccountAmount.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AccountAmount(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.amount = r.sint64(); + break; + } + case 3: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AccountAmount + * @function getTypeUrl + * @memberof proto.AccountAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccountAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AccountAmount"; + }; + + return AccountAmount; + })(); + + proto.TransferList = (function() { + + /** + * Properties of a TransferList. + * @memberof proto + * @interface ITransferList + * @property {Array.|null} [accountAmounts] A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + */ + + /** + * Constructs a new TransferList. + * @memberof proto + * @classdesc A list of accounts and amounts to transfer. + * + * Each `AccountAmount` SHALL specify the account and the amount to + * send(negative) or receive(positive).
+ * Each `TransferList` SHALL be contained in another message that contains + * other details required to complete a transfer. This is typically a + * `CryptoTransferTransactionBody` or `TransactionRecord`.
+ * The `TransferList` SHALL only be used for HBAR transfers. Other token types + * MUST use the `TokenTransferList` message. + * @implements ITransferList + * @constructor + * @param {proto.ITransferList=} [p] Properties to set + */ + function TransferList(p) { + this.accountAmounts = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of AccountAmount pairs.
+ * Each entry in this list is an account and an amount to transfer + * into it (positive) or out of it (negative) + * @member {Array.} accountAmounts + * @memberof proto.TransferList + * @instance + */ + TransferList.prototype.accountAmounts = $util.emptyArray; + + /** + * Creates a new TransferList instance using the specified properties. + * @function create + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList=} [properties] Properties to set + * @returns {proto.TransferList} TransferList instance + */ + TransferList.create = function create(properties) { + return new TransferList(properties); + }; + + /** + * Encodes the specified TransferList message. Does not implicitly {@link proto.TransferList.verify|verify} messages. + * @function encode + * @memberof proto.TransferList + * @static + * @param {proto.ITransferList} m TransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountAmounts != null && m.accountAmounts.length) { + for (var i = 0; i < m.accountAmounts.length; ++i) + $root.proto.AccountAmount.encode(m.accountAmounts[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransferList} TransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.accountAmounts && m.accountAmounts.length)) + m.accountAmounts = []; + m.accountAmounts.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransferList + * @function getTypeUrl + * @memberof proto.TransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransferList"; + }; + + return TransferList; + })(); + + proto.NftTransfer = (function() { + + /** + * Properties of a NftTransfer. + * @memberof proto + * @interface INftTransfer + * @property {proto.IAccountID|null} [senderAccountID] An Account identifier for the sender. + * @property {proto.IAccountID|null} [receiverAccountID] An Account identifier for the receiver. + * @property {Long|null} [serialNumber] A serial number for the NFT to transfer. + * @property {boolean|null} [isApproval] An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + */ + + /** + * Constructs a new NftTransfer. + * @memberof proto + * @classdesc A NFT transfer.
+ * This refers to a sender account, a receiver account, and the serial number + * of an NFT to transfer from sender to receiver. + * + * Each `NftTransfer` SHALL be contained in another message (typically + * `TokenTransferList`) that details which `Token` type applies to this NFT + * transfer. + * @implements INftTransfer + * @constructor + * @param {proto.INftTransfer=} [p] Properties to set + */ + function NftTransfer(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An Account identifier for the sender. + * @member {proto.IAccountID|null|undefined} senderAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.senderAccountID = null; + + /** + * An Account identifier for the receiver. + * @member {proto.IAccountID|null|undefined} receiverAccountID + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.receiverAccountID = null; + + /** + * A serial number for the NFT to transfer. + * @member {Long} serialNumber + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.serialNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An approved allowance flag.
+ * If true then the transfer is expected to be an approved allowance. + *

+ * If set, `senderAccountID` SHALL be the owner that previously approved + * the allowance.
+ * If set, the `senderAccountID` MUST be the "payer" account for + * the transaction
+ * The default value SHALL be false (unset). + * @member {boolean} isApproval + * @memberof proto.NftTransfer + * @instance + */ + NftTransfer.prototype.isApproval = false; + + /** + * Creates a new NftTransfer instance using the specified properties. + * @function create + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer=} [properties] Properties to set + * @returns {proto.NftTransfer} NftTransfer instance + */ + NftTransfer.create = function create(properties) { + return new NftTransfer(properties); + }; + + /** + * Encodes the specified NftTransfer message. Does not implicitly {@link proto.NftTransfer.verify|verify} messages. + * @function encode + * @memberof proto.NftTransfer + * @static + * @param {proto.INftTransfer} m NftTransfer message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NftTransfer.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderAccountID != null && Object.hasOwnProperty.call(m, "senderAccountID")) + $root.proto.AccountID.encode(m.senderAccountID, w.uint32(10).fork()).ldelim(); + if (m.receiverAccountID != null && Object.hasOwnProperty.call(m, "receiverAccountID")) + $root.proto.AccountID.encode(m.receiverAccountID, w.uint32(18).fork()).ldelim(); + if (m.serialNumber != null && Object.hasOwnProperty.call(m, "serialNumber")) + w.uint32(24).int64(m.serialNumber); + if (m.isApproval != null && Object.hasOwnProperty.call(m, "isApproval")) + w.uint32(32).bool(m.isApproval); + return w; + }; + + /** + * Decodes a NftTransfer message from the specified reader or buffer. + * @function decode + * @memberof proto.NftTransfer + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NftTransfer} NftTransfer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NftTransfer.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NftTransfer(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverAccountID = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.serialNumber = r.int64(); + break; + } + case 4: { + m.isApproval = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NftTransfer + * @function getTypeUrl + * @memberof proto.NftTransfer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NftTransfer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NftTransfer"; + }; + + return NftTransfer; + })(); + + proto.TokenTransferList = (function() { + + /** + * Properties of a TokenTransferList. + * @memberof proto + * @interface ITokenTransferList + * @property {proto.ITokenID|null} [token] A token identifier.
+ * This is the token to be transferred. + * @property {Array.|null} [transfers] A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @property {Array.|null} [nftTransfers] A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @property {google.protobuf.IUInt32Value|null} [expectedDecimals] An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + */ + + /** + * Constructs a new TokenTransferList. + * @memberof proto + * @classdesc A list of transfers for a particular (non-HBAR) token type. + * + * A `TokenTransferList` applies to a single token type, but may contain many + * individual transfers.
+ * Each transfer of a fungible/common token MUST specify an `accountID` and + * `amount`. Amount SHALL be positive when the account receives tokens, and + * SHALL be negative when the account sends tokens. The amount SHOULD NOT be + * `0`.
+ * In a transfer list containing fungible/common tokens in the `transfers` + * list, the sum of all such transfers MUST be zero (`0`). + * Each transfer of a unique token SHALL specify both sender and receiver, as + * well as the serial number transferred.
+ * A single `TokenTransferList` MUST contain `transfers` or `nftTransfers`, + * but MUST NOT contain both. + * @implements ITokenTransferList + * @constructor + * @param {proto.ITokenTransferList=} [p] Properties to set + */ + function TokenTransferList(p) { + this.transfers = []; + this.nftTransfers = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier.
+ * This is the token to be transferred. + * @member {proto.ITokenID|null|undefined} token + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.token = null; + + /** + * A list of account amounts. + *

+ * Each entry SHALL have an account and amount.
+ * These transfers SHALL be "double-entry" style; the credits (positive + * amount) and debits (negative amount) MUST sum to 0, unless this + * transfer list is part of a `mint` or `burn` operation.
+ * This SHALL be be set for fungible/common tokens and MUST be + * empty otherwise. + * @member {Array.} transfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.transfers = $util.emptyArray; + + /** + * A list of NftTransfers. + *

+ * Each entry SHALL have a sender and receiver account, and the + * serial number of the unique token to transfer.
+ * This SHALL be be set for non-fungible/unique tokens and SHALL be + * empty otherwise. + * @member {Array.} nftTransfers + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.nftTransfers = $util.emptyArray; + + /** + * An expected decimal precision.
+ * This is the number of decimals a fungible/common token type is + * _expected_ to have. + *

+ * The transfer SHALL fail with response code `UNEXPECTED_TOKEN_DECIMALS` + * if this is set and the actual decimals specified for the `Token` differ + * from this value.
+ * If `nftTransfers` is set, then this value SHOULD NOT be set. + * @member {google.protobuf.IUInt32Value|null|undefined} expectedDecimals + * @memberof proto.TokenTransferList + * @instance + */ + TokenTransferList.prototype.expectedDecimals = null; + + /** + * Creates a new TokenTransferList instance using the specified properties. + * @function create + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList=} [properties] Properties to set + * @returns {proto.TokenTransferList} TokenTransferList instance + */ + TokenTransferList.create = function create(properties) { + return new TokenTransferList(properties); + }; + + /** + * Encodes the specified TokenTransferList message. Does not implicitly {@link proto.TokenTransferList.verify|verify} messages. + * @function encode + * @memberof proto.TokenTransferList + * @static + * @param {proto.ITokenTransferList} m TokenTransferList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenTransferList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.token != null && Object.hasOwnProperty.call(m, "token")) + $root.proto.TokenID.encode(m.token, w.uint32(10).fork()).ldelim(); + if (m.transfers != null && m.transfers.length) { + for (var i = 0; i < m.transfers.length; ++i) + $root.proto.AccountAmount.encode(m.transfers[i], w.uint32(18).fork()).ldelim(); + } + if (m.nftTransfers != null && m.nftTransfers.length) { + for (var i = 0; i < m.nftTransfers.length; ++i) + $root.proto.NftTransfer.encode(m.nftTransfers[i], w.uint32(26).fork()).ldelim(); + } + if (m.expectedDecimals != null && Object.hasOwnProperty.call(m, "expectedDecimals")) + $root.google.protobuf.UInt32Value.encode(m.expectedDecimals, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenTransferList message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenTransferList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenTransferList} TokenTransferList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenTransferList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenTransferList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.token = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.transfers && m.transfers.length)) + m.transfers = []; + m.transfers.push($root.proto.AccountAmount.decode(r, r.uint32())); + break; + } + case 3: { + if (!(m.nftTransfers && m.nftTransfers.length)) + m.nftTransfers = []; + m.nftTransfers.push($root.proto.NftTransfer.decode(r, r.uint32())); + break; + } + case 4: { + m.expectedDecimals = $root.google.protobuf.UInt32Value.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenTransferList + * @function getTypeUrl + * @memberof proto.TokenTransferList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenTransferList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenTransferList"; + }; + + return TokenTransferList; + })(); + + proto.Fraction = (function() { + + /** + * Properties of a Fraction. + * @memberof proto + * @interface IFraction + * @property {Long|null} [numerator] A fractional number's numerator. + * @property {Long|null} [denominator] A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + */ + + /** + * Constructs a new Fraction. + * @memberof proto + * @classdesc A rational number.
+ * A common use is to set the amount of a value transfer to collect as a + * custom fee. + * + * It is RECOMMENDED that both numerator and denominator be no larger than + * necessary to express the required fraction. A very large numerator, in + * particular, may not be reliable. + * Both fields are REQUIRED and SHOULD be positive integers. + * @implements IFraction + * @constructor + * @param {proto.IFraction=} [p] Properties to set + */ + function Fraction(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fractional number's numerator. + * @member {Long} numerator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.numerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A fractional number's denominator. + *

+ * A zero value SHALL fail with response code `FRACTION_DIVIDES_BY_ZERO`. + * @member {Long} denominator + * @memberof proto.Fraction + * @instance + */ + Fraction.prototype.denominator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Fraction instance using the specified properties. + * @function create + * @memberof proto.Fraction + * @static + * @param {proto.IFraction=} [properties] Properties to set + * @returns {proto.Fraction} Fraction instance + */ + Fraction.create = function create(properties) { + return new Fraction(properties); + }; + + /** + * Encodes the specified Fraction message. Does not implicitly {@link proto.Fraction.verify|verify} messages. + * @function encode + * @memberof proto.Fraction + * @static + * @param {proto.IFraction} m Fraction message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fraction.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.numerator != null && Object.hasOwnProperty.call(m, "numerator")) + w.uint32(8).int64(m.numerator); + if (m.denominator != null && Object.hasOwnProperty.call(m, "denominator")) + w.uint32(16).int64(m.denominator); + return w; + }; + + /** + * Decodes a Fraction message from the specified reader or buffer. + * @function decode + * @memberof proto.Fraction + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Fraction} Fraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fraction.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Fraction(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.numerator = r.int64(); + break; + } + case 2: { + m.denominator = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Fraction + * @function getTypeUrl + * @memberof proto.Fraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Fraction"; + }; + + return Fraction; + })(); + + /** + * Possible Token Types (IWA Compatibility). + * + * Apart from fungible and non-fungible, Tokens can have either a common or + * unique representation. Furthermore, tokens can have intrinsic or referential + * value, and can be whole and indivisible or fractional.
+ * These distinction might seem subtle, but it is important when considering + * how tokens can be traced, used, transferred, and if they can have isolated + * unique properties. + * + * A few examples (these may not match enumerations below) using IWA taxonomy. + *

+ *
fungible, whole, intrinsic, unique
+ *
Physical fiat currency
+ *
fungible, fractional, intrinsic, common
+ *
bank balance fiat currency
+ *
non-fungible, fractional, reference, unique
+ *
"mutual" collectible/art/property ownership
+ *
non-fungible, whole, intrinsic, unique
+ *
Physical work of fine art
+ *
non-fungible, whole, reference, unique
+ *
Registered property title
+ *
+ * @name proto.TokenType + * @enum {number} + * @property {number} FUNGIBLE_COMMON=0 A fungible/common token.
+ * Tokens of this type are interchangeable with one another, where any + * quantity of tokens has the same value as another equal quantity, if + * they are in the same class. Tokens share a single set of properties, + * and are not distinct from one another. Ownership is represented as a + * balance or quantity associated to a given account. Tokens may be + * divided into fractional tokens, within reasonable limits. + *

+ * IWA taxonomy _fungible, fractional, intrinsic, common_ + * @property {number} NON_FUNGIBLE_UNIQUE=1 A non-fungible/unique token.
+ * Tokens of this type are unique, and are not interchangeable with other + * tokens of the same type. Each token carries a serial number which is + * unique for that token, these tokens may have a different trade value + * for each individual token. The tokens are individually accounted and + * often carry additional unique properties. Tokens cannot be subdivided, + * and value is related to what the individual token represents. + *

+ * IWA taxonomy _non-fungible, whole, reference, unique_ + */ + proto.TokenType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNGIBLE_COMMON"] = 0; + values[valuesById[1] = "NON_FUNGIBLE_UNIQUE"] = 1; + return values; + })(); + + /** + * A transaction sub type.
+ * This enumeration enables a set of transaction base fees to be broadly + * defined for a type of operation and also be modified, when necessary, + * based on specifics of the operation. + * + * ### Explanation + * The resource cost for a TokenMint operation is different between minting + * fungible/common and non-fungible/unique tokens. This `enum` is used to + * "mark" a cost as applying to one or the other.
+ * Similarly, the resource cost for a basic `tokenCreate` without a custom + * fee schedule may yield a _base_ fee of $1. The resource cost for a + * `tokenCreate` _with_ a custom fee schedule is different and may yield a + * _base_ fee of $2 or more. + * @name proto.SubType + * @enum {number} + * @property {number} DEFAULT=0 The resource cost for the transaction type has no additional attributes + * @property {number} TOKEN_FUNGIBLE_COMMON=1 The resource cost for the transaction type includes an operation on a + * fungible/common token + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE=2 The resource cost for the transaction type includes an operation on + * a non-fungible/unique token + * @property {number} TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES=3 The resource cost for the transaction type includes an operation on a + * fungible/common token with a custom fee schedule + * @property {number} TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES=4 The resource cost for the transaction type includes an operation on a + * non-fungible/unique token with a custom fee schedule + * @property {number} SCHEDULE_CREATE_CONTRACT_CALL=5 The resource cost for the transaction type includes a ScheduleCreate + * containing a ContractCall. + * @property {number} TOPIC_CREATE_WITH_CUSTOM_FEES=6 The resource cost for the transaction type includes a TopicCreate + * with custom fees. + * @property {number} SUBMIT_MESSAGE_WITH_CUSTOM_FEES=7 The resource cost for the transaction type includes a ConsensusSubmitMessage + * for a topic with custom fees. + */ + proto.SubType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "TOKEN_FUNGIBLE_COMMON"] = 1; + values[valuesById[2] = "TOKEN_NON_FUNGIBLE_UNIQUE"] = 2; + values[valuesById[3] = "TOKEN_FUNGIBLE_COMMON_WITH_CUSTOM_FEES"] = 3; + values[valuesById[4] = "TOKEN_NON_FUNGIBLE_UNIQUE_WITH_CUSTOM_FEES"] = 4; + values[valuesById[5] = "SCHEDULE_CREATE_CONTRACT_CALL"] = 5; + values[valuesById[6] = "TOPIC_CREATE_WITH_CUSTOM_FEES"] = 6; + values[valuesById[7] = "SUBMIT_MESSAGE_WITH_CUSTOM_FEES"] = 7; + return values; + })(); + + /** + * Possible Token Supply Types (IWA Compatibility). + * + * This `enum` indicates the limit of tokens that can exist during the + * lifetime of a token definition. The "infinite" supply is only theoretically + * infinite, as it is still limited to the magnitude of a 64-bit signed + * integer. A "finite" supply is further limited to a value specified when + * the token is created (or updated, if not immutable). + * @name proto.TokenSupplyType + * @enum {number} + * @property {number} INFINITE=0 An unlimited supply.
+ * This indicates that tokens of this type have an upper bound of + * Long.MAX_VALUE.
+ * The supply is accounted in the smallest units of the token + * (i.e. 10-`decimals` whole tokens) + * @property {number} FINITE=1 A limited supply.
+ * This indicates that tokens of this type have an upper bound of + * `maxSupply`.
+ * The maximum supply SHALL be provided on token creation, but MAY be + * changed thereafter if the token has an `admin_key` set. + */ + proto.TokenSupplyType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INFINITE"] = 0; + values[valuesById[1] = "FINITE"] = 1; + return values; + })(); + + /** + * Types of validation strategies for token keys. + * @name proto.TokenKeyValidation + * @enum {number} + * @property {number} FULL_VALIDATION=0 Perform all token key validations.
+ * This is the default value and behavior. + * @property {number} NO_VALIDATION=1 Perform no validations at all for all passed token keys. + */ + proto.TokenKeyValidation = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FULL_VALIDATION"] = 0; + values[valuesById[1] = "NO_VALIDATION"] = 1; + return values; + })(); + + /** + * Possible token freeze status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenFreezeStatus + * @enum {number} + * @property {number} FreezeNotApplicable=0 The token does not support freeze or cannot be frozen for the designated + * account.
+ * Typically this indicates that the token does not have a `freeze_key` set. + * @property {number} Frozen=1 The token is currently frozen for the designated account. + * @property {number} Unfrozen=2 The token is not currently frozen for the designated account. + */ + proto.TokenFreezeStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FreezeNotApplicable"] = 0; + values[valuesById[1] = "Frozen"] = 1; + values[valuesById[2] = "Unfrozen"] = 2; + return values; + })(); + + /** + * Possible token "KYC" status values. + * + * This is returned by `TokenGetInfoQuery` or `CryptoGetInfoResponse` + * in `TokenRelationship`. + * @name proto.TokenKycStatus + * @enum {number} + * @property {number} KycNotApplicable=0 The token does not support KYC or cannot grant KYC for the + * designated account.
+ * Typically this indicates that the token does not have a `kyc_key` set. + * @property {number} Granted=1 The designated account is currently granted KYC status for the + * designated token. + * @property {number} Revoked=2 The designated account is not currently granted KYC status for the + * designated token. + */ + proto.TokenKycStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KycNotApplicable"] = 0; + values[valuesById[1] = "Granted"] = 1; + values[valuesById[2] = "Revoked"] = 2; + return values; + })(); + + /** + * Possible Pause status values. + * + * This is returned by `TokenGetInfoQuery` in `TokenRelationship`. + * @name proto.TokenPauseStatus + * @enum {number} + * @property {number} PauseNotApplicable=0 The token does not support pause or cannot be paused.
+ * Typically this indicates that the token does not have a `pause_key` set. + * @property {number} Paused=1 The token is currently paused. + * @property {number} Unpaused=2 The token is not currently paused. + */ + proto.TokenPauseStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PauseNotApplicable"] = 0; + values[valuesById[1] = "Paused"] = 1; + values[valuesById[2] = "Unpaused"] = 2; + return values; + })(); + + proto.Key = (function() { + + /** + * Properties of a Key. + * @memberof proto + * @interface IKey + * @property {proto.IContractID|null} [contractID] A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @property {Uint8Array|null} [ed25519] An array of Ed25519 public key bytes. + * @property {Uint8Array|null} [RSA_3072] This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @property {Uint8Array|null} [ECDSA_384] This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @property {proto.IThresholdKey|null} [thresholdKey] A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @property {proto.IKeyList|null} [keyList] A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @property {Uint8Array|null} [ECDSASecp256k1] A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @property {proto.IContractID|null} [delegatableContractId] A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + */ + + /** + * Constructs a new Key. + * @memberof proto + * @classdesc A Key is an entity representing one or more cryptographic public/private key + * pairs and, optionally, the structure for how multiple signatures may be + * composed to meet complex multiple-signature authorization requirements. + * + * A Key can be a public key from either the Ed25519 or ECDSA(secp256k1) + * signature schemes. In the ECDSA(secp256k1) case we require the 33-byte + * compressed form of the public key. For simplicity, we call these + * cryptographic public keys `primitive` keys.
+ * If an entity has a primitive key associated to it, then the corresponding + * private key must sign any transaction to send tokens or perform other + * actions requiring authorization. + * + * A Key can also be the ID of a smart contract, which SHALL authorize that + * contract to execute any system contract with signing requirements that are + * met by the key.
+ * > Example + * >> If account `0.0.A` has a threshold key whose threshold is satisfied + * >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called, + * >> it is authorized to use system contracts to manage any asset owned by + * >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even + * >> perform these actions when running code accessed via `DELEGATECALL`. + * + * A Key can be a "threshold key", which is a list of N keys, any M of which + * may sign in order for the signature to be considered valid. The value of + * M for a given threshold key MUST be less than or equal to N. A threshold + * key is sometimes called a "M-of-N" key. + * + * 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).
+ * This implies that the use of a key list is dependent on context. For + * example, an Hedera file that is created with a list of keys, SHALL require + * that all of those keys must sign a transaction to create or modify the file, + * but only one key from that list MUST sign a transaction to delete the file. + * So it is a single list that sometimes acts as a N-of-N threshold key, and + * sometimes acts as a 1-of-N threshold key.
+ * To reduce confusion this may cause, a key list SHALL always be considered + * N-of-N, unless specified otherwise in official documentation.
+ * A key list MAY have repeated primitive public keys, but the signature + * requirement for all keys in a repeated set SHALL be satisfied by a single + * valid signature. There is no mechanism to require a single key to sign a + * single transaction more than once. + * + * Any list or threshold key MAY have nested key lists or threshold keys. + * This allows, for example, the keys within a threshold signature to + * themselves be threshold, list, contract, or primitive keys. This nesting + * structure enables complex asymmetric multi-party signature requirements to + * be met. + * + * To ensure adequate performance and transaction security, key nesting is + * limited to at most fifteen(15) levels. + * @implements IKey + * @constructor + * @param {proto.IKey=} [p] Properties to set + */ + function Key(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A smart contract instance that is authorized implicitly. + *

+ * This key type SHALL require that the code in the active message frame + * belong to the contract with the given id. + * @member {proto.IContractID|null|undefined} contractID + * @memberof proto.Key + * @instance + */ + Key.prototype.contractID = null; + + /** + * An array of Ed25519 public key bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Key + * @instance + */ + Key.prototype.ed25519 = null; + + /** + * This option is not currently supported.
+ * An array of RSA-3072 public key bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Key + * @instance + */ + Key.prototype.RSA_3072 = null; + + /** + * This option is not currently supported.
+ * An array of ECDSA, using the p-384 curve, public key bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSA_384 = null; + + /** + * A threshold, M, combined with a list of N keys, any M of which are + * sufficient to form a valid signature. + * @member {proto.IThresholdKey|null|undefined} thresholdKey + * @memberof proto.Key + * @instance + */ + Key.prototype.thresholdKey = null; + + /** + * A list of keys. This may be treated like a "N-of-N" threshold key, + * as a component of another key, or in some other manner as documented. + * @member {proto.IKeyList|null|undefined} keyList + * @memberof proto.Key + * @instance + */ + Key.prototype.keyList = null; + + /** + * A set of compressed ECDSA(secp256k1) public key bytes.
+ * This is an EVM compatibility format. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.Key + * @instance + */ + Key.prototype.ECDSASecp256k1 = null; + + /** + * A smart contract that, if the recipient of the active message frame, + * SHALL be imputed authorization.
+ * Setting this key type is a more permissive version of setting a + * contractID key. + *

+ * This key form SHALL NOT strictly require that the code being executed + * in the frame belong to the given contract. The code in frame MAY be + * running another contract via a `delegatecall`. + * @member {proto.IContractID|null|undefined} delegatableContractId + * @memberof proto.Key + * @instance + */ + Key.prototype.delegatableContractId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Key key. + * @member {"contractID"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdKey"|"keyList"|"ECDSASecp256k1"|"delegatableContractId"|undefined} key + * @memberof proto.Key + * @instance + */ + Object.defineProperty(Key.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["contractID", "ed25519", "RSA_3072", "ECDSA_384", "thresholdKey", "keyList", "ECDSASecp256k1", "delegatableContractId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Key instance using the specified properties. + * @function create + * @memberof proto.Key + * @static + * @param {proto.IKey=} [properties] Properties to set + * @returns {proto.Key} Key instance + */ + Key.create = function create(properties) { + return new Key(properties); + }; + + /** + * Encodes the specified Key message. Does not implicitly {@link proto.Key.verify|verify} messages. + * @function encode + * @memberof proto.Key + * @static + * @param {proto.IKey} m Key message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Key.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contractID != null && Object.hasOwnProperty.call(m, "contractID")) + $root.proto.ContractID.encode(m.contractID, w.uint32(10).fork()).ldelim(); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdKey != null && Object.hasOwnProperty.call(m, "thresholdKey")) + $root.proto.ThresholdKey.encode(m.thresholdKey, w.uint32(42).fork()).ldelim(); + if (m.keyList != null && Object.hasOwnProperty.call(m, "keyList")) + $root.proto.KeyList.encode(m.keyList, w.uint32(50).fork()).ldelim(); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(58).bytes(m.ECDSASecp256k1); + if (m.delegatableContractId != null && Object.hasOwnProperty.call(m, "delegatableContractId")) + $root.proto.ContractID.encode(m.delegatableContractId, w.uint32(66).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Key message from the specified reader or buffer. + * @function decode + * @memberof proto.Key + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Key} Key + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Key.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Key(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contractID = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdKey = $root.proto.ThresholdKey.decode(r, r.uint32()); + break; + } + case 6: { + m.keyList = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + case 7: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + case 8: { + m.delegatableContractId = $root.proto.ContractID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Key + * @function getTypeUrl + * @memberof proto.Key + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Key"; + }; + + return Key; + })(); + + proto.ThresholdKey = (function() { + + /** + * Properties of a ThresholdKey. + * @memberof proto + * @interface IThresholdKey + * @property {number|null} [threshold] A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @property {proto.IKeyList|null} [keys] A list of the keys that MAY satisfy signature requirements of this key. + */ + + /** + * Constructs a new ThresholdKey. + * @memberof proto + * @classdesc A threshold value and a list of public keys that, together, form a threshold + * signature requirement. Any subset of the keys in the list may satisfy the + * signature requirements of this type of key, provided the number of keys meets + * or exceeds the threshold. For example, if a particular key has a threshold of + * three(3) and eight(8) keys in the list, then any three(3) signatures, from + * the list of eight(8), is sufficient to authorize that key. + * + * For threshold purposes, all signatures from a single `primitive` key are + * considered a single signature, so that signature(s) from a single key SHALL + * NOT _directly_ meet a threshold greater than one(1). + * + * #### Note + * > It is possible to construct a complex key structure that _would_ enable a + * > single primitive key to successfully meet a threshold requirement. All + * > threshold keys SHOULD be carefully audited to ensure no one `primitive` + * > key, or smart contract, has disproportionate capability. + * @implements IThresholdKey + * @constructor + * @param {proto.IThresholdKey=} [p] Properties to set + */ + function ThresholdKey(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A transaction MUST have valid signatures from at least this number of + * separate keys, from the `keys` list to be authorized by this key. + * @member {number} threshold + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.threshold = 0; + + /** + * A list of the keys that MAY satisfy signature requirements of this key. + * @member {proto.IKeyList|null|undefined} keys + * @memberof proto.ThresholdKey + * @instance + */ + ThresholdKey.prototype.keys = null; + + /** + * Creates a new ThresholdKey instance using the specified properties. + * @function create + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey=} [properties] Properties to set + * @returns {proto.ThresholdKey} ThresholdKey instance + */ + ThresholdKey.create = function create(properties) { + return new ThresholdKey(properties); + }; + + /** + * Encodes the specified ThresholdKey message. Does not implicitly {@link proto.ThresholdKey.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdKey + * @static + * @param {proto.IThresholdKey} m ThresholdKey message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdKey.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.threshold != null && Object.hasOwnProperty.call(m, "threshold")) + w.uint32(8).uint32(m.threshold); + if (m.keys != null && Object.hasOwnProperty.call(m, "keys")) + $root.proto.KeyList.encode(m.keys, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdKey message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdKey + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdKey} ThresholdKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdKey.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdKey(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.threshold = r.uint32(); + break; + } + case 2: { + m.keys = $root.proto.KeyList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdKey + * @function getTypeUrl + * @memberof proto.ThresholdKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdKey"; + }; + + return ThresholdKey; + })(); + + proto.KeyList = (function() { + + /** + * Properties of a KeyList. + * @memberof proto + * @interface IKeyList + * @property {Array.|null} [keys] A list of keys. All values in this list SHALL be non-null. + *

+ */ + + /** + * Constructs a new KeyList. + * @memberof proto + * @classdesc A list of keys.
+ * A `KeyList` requires all keys (N-of-N) to sign, unless otherwise + * specified in official documentation. A KeyList may contain repeated keys, + * but all such repeated keys are considered a single key when determining + * signature authorization. + * + * ### Additional Notes + * 1. An empty key list is the "standard" mechanism to represent an + * unassigned key. For example, if the `admin_key` of a token is set + * to the empty key list, then that token has no admin key, and + * functionality that requires an admin key to sign the + * transaction is disabled. + * @implements IKeyList + * @constructor + * @param {proto.IKeyList=} [p] Properties to set + */ + function KeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of keys. All values in this list SHALL be non-null. + *

+ * @member {Array.} keys + * @memberof proto.KeyList + * @instance + */ + KeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new KeyList instance using the specified properties. + * @function create + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList=} [properties] Properties to set + * @returns {proto.KeyList} KeyList instance + */ + KeyList.create = function create(properties) { + return new KeyList(properties); + }; + + /** + * Encodes the specified KeyList message. Does not implicitly {@link proto.KeyList.verify|verify} messages. + * @function encode + * @memberof proto.KeyList + * @static + * @param {proto.IKeyList} m KeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a KeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.KeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.KeyList} KeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.KeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for KeyList + * @function getTypeUrl + * @memberof proto.KeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.KeyList"; + }; + + return KeyList; + })(); + + proto.Signature = (function() { + + /** + * Properties of a Signature. + * @memberof proto + * @interface ISignature + * @property {Uint8Array|null} [contract] Smart contract virtual signature (always length zero). + * @property {Uint8Array|null} [ed25519] Ed25519 signature bytes. + * @property {Uint8Array|null} [RSA_3072] RSA-3072 signature bytes. + * @property {Uint8Array|null} [ECDSA_384] ECDSA p-384 signature bytes. + * @property {proto.IThresholdSignature|null} [thresholdSignature] 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. + * @property {proto.ISignatureList|null} [signatureList] A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + */ + + /** + * Constructs a new Signature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with + * network nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignature + * @constructor + * @param {proto.ISignature=} [p] Properties to set + */ + function Signature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Smart contract virtual signature (always length zero). + * @member {Uint8Array|null|undefined} contract + * @memberof proto.Signature + * @instance + */ + Signature.prototype.contract = null; + + /** + * Ed25519 signature bytes. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ed25519 = null; + + /** + * RSA-3072 signature bytes. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.RSA_3072 = null; + + /** + * ECDSA p-384 signature bytes. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.Signature + * @instance + */ + Signature.prototype.ECDSA_384 = null; + + /** + * 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. + * @member {proto.IThresholdSignature|null|undefined} thresholdSignature + * @memberof proto.Signature + * @instance + */ + Signature.prototype.thresholdSignature = null; + + /** + * A list of M signatures, each corresponding to a Key in a KeyList + * of the same length. + * @member {proto.ISignatureList|null|undefined} signatureList + * @memberof proto.Signature + * @instance + */ + Signature.prototype.signatureList = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Signature signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"thresholdSignature"|"signatureList"|undefined} signature + * @memberof proto.Signature + * @instance + */ + Object.defineProperty(Signature.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "thresholdSignature", "signatureList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Signature instance using the specified properties. + * @function create + * @memberof proto.Signature + * @static + * @param {proto.ISignature=} [properties] Properties to set + * @returns {proto.Signature} Signature instance + */ + Signature.create = function create(properties) { + return new Signature(properties); + }; + + /** + * Encodes the specified Signature message. Does not implicitly {@link proto.Signature.verify|verify} messages. + * @function encode + * @memberof proto.Signature + * @static + * @param {proto.ISignature} m Signature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Signature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(10).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(18).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(26).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(34).bytes(m.ECDSA_384); + if (m.thresholdSignature != null && Object.hasOwnProperty.call(m, "thresholdSignature")) + $root.proto.ThresholdSignature.encode(m.thresholdSignature, w.uint32(42).fork()).ldelim(); + if (m.signatureList != null && Object.hasOwnProperty.call(m, "signatureList")) + $root.proto.SignatureList.encode(m.signatureList, w.uint32(50).fork()).ldelim(); + return w; + }; + + /** + * Decodes a Signature message from the specified reader or buffer. + * @function decode + * @memberof proto.Signature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Signature} Signature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Signature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Signature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.contract = r.bytes(); + break; + } + case 2: { + m.ed25519 = r.bytes(); + break; + } + case 3: { + m.RSA_3072 = r.bytes(); + break; + } + case 4: { + m.ECDSA_384 = r.bytes(); + break; + } + case 5: { + m.thresholdSignature = $root.proto.ThresholdSignature.decode(r, r.uint32()); + break; + } + case 6: { + m.signatureList = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Signature + * @function getTypeUrl + * @memberof proto.Signature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Signature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Signature"; + }; + + return Signature; + })(); + + proto.ThresholdSignature = (function() { + + /** + * Properties of a ThresholdSignature. + * @memberof proto + * @interface IThresholdSignature + * @property {proto.ISignatureList|null} [sigs] For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + */ + + /** + * Constructs a new ThresholdSignature. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages, in combination + * with `ThresholdKey` keys, instead of this message. + * @implements IThresholdSignature + * @constructor + * @param {proto.IThresholdSignature=} [p] Properties to set + */ + function ThresholdSignature(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * For an N-of-M threshold key, this is a list of M signatures, at least N + * of which must be non-null. + * @member {proto.ISignatureList|null|undefined} sigs + * @memberof proto.ThresholdSignature + * @instance + */ + ThresholdSignature.prototype.sigs = null; + + /** + * Creates a new ThresholdSignature instance using the specified properties. + * @function create + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature=} [properties] Properties to set + * @returns {proto.ThresholdSignature} ThresholdSignature instance + */ + ThresholdSignature.create = function create(properties) { + return new ThresholdSignature(properties); + }; + + /** + * Encodes the specified ThresholdSignature message. Does not implicitly {@link proto.ThresholdSignature.verify|verify} messages. + * @function encode + * @memberof proto.ThresholdSignature + * @static + * @param {proto.IThresholdSignature} m ThresholdSignature message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThresholdSignature.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && Object.hasOwnProperty.call(m, "sigs")) + $root.proto.SignatureList.encode(m.sigs, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a ThresholdSignature message from the specified reader or buffer. + * @function decode + * @memberof proto.ThresholdSignature + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ThresholdSignature} ThresholdSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThresholdSignature.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ThresholdSignature(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + m.sigs = $root.proto.SignatureList.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ThresholdSignature + * @function getTypeUrl + * @memberof proto.ThresholdSignature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThresholdSignature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ThresholdSignature"; + }; + + return ThresholdSignature; + })(); + + proto.SignatureList = (function() { + + /** + * Properties of a SignatureList. + * @memberof proto + * @interface ISignatureList + * @property {Array.|null} [sigs] Each signature corresponds to a Key in the KeyList. + */ + + /** + * Constructs a new SignatureList. + * @memberof proto + * @classdesc This message is deprecated and MUST NOT be used to communicate with network + * nodes. It is retained here only for historical reasons. + * + * Client software MUST NOT include this message in any request.
+ * Compliant nodes SHALL NOT accept any request containing this message. + * + * Please use the `SignaturePair` and `SignatureMap` messages instead of + * this message. + * @implements ISignatureList + * @constructor + * @param {proto.ISignatureList=} [p] Properties to set + */ + function SignatureList(p) { + this.sigs = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Each signature corresponds to a Key in the KeyList. + * @member {Array.} sigs + * @memberof proto.SignatureList + * @instance + */ + SignatureList.prototype.sigs = $util.emptyArray; + + /** + * Creates a new SignatureList instance using the specified properties. + * @function create + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList=} [properties] Properties to set + * @returns {proto.SignatureList} SignatureList instance + */ + SignatureList.create = function create(properties) { + return new SignatureList(properties); + }; + + /** + * Encodes the specified SignatureList message. Does not implicitly {@link proto.SignatureList.verify|verify} messages. + * @function encode + * @memberof proto.SignatureList + * @static + * @param {proto.ISignatureList} m SignatureList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigs != null && m.sigs.length) { + for (var i = 0; i < m.sigs.length; ++i) + $root.proto.Signature.encode(m.sigs[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureList message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureList} SignatureList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 2: { + if (!(m.sigs && m.sigs.length)) + m.sigs = []; + m.sigs.push($root.proto.Signature.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureList + * @function getTypeUrl + * @memberof proto.SignatureList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureList"; + }; + + return SignatureList; + })(); + + proto.SignaturePair = (function() { + + /** + * Properties of a SignaturePair. + * @memberof proto + * @interface ISignaturePair + * @property {Uint8Array|null} [pubKeyPrefix] Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @property {Uint8Array|null} [contract] A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @property {Uint8Array|null} [ed25519] An Ed25519 signature. + * @property {Uint8Array|null} [RSA_3072] This option is not supported.
+ * A RSA-3072 signature. + * @property {Uint8Array|null} [ECDSA_384] This option is not supported.
+ * ECDSA p-384 signature. + * @property {Uint8Array|null} [ECDSASecp256k1] An ECDSA(secp256k1) signature. + */ + + /** + * Constructs a new SignaturePair. + * @memberof proto + * @classdesc A public key and signature pair.
+ * Only Ed25519 and ECDSA(secp256k1) keys and signatures are currently supported + * as cryptographic (non-implied) signatures. + * @implements ISignaturePair + * @constructor + * @param {proto.ISignaturePair=} [p] Properties to set + */ + function SignaturePair(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Prefix bytes of the public key. + *

+ * 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 + * true that only one cryptographic key is required to sign the associated + * transaction.
+ * If the `pubKeyPrefix` is 0 bytes and more than a single cryptographic + * key is required to sign the transaction, the request SHALL resolve to + * `INVALID_SIGNATURE`. + *

Important Note
+ * In the special case that a signature is provided to authorize a + * precompiled contract, the `pubKeyPrefix` MUST contain the _entire public + * key_.
+ * That is, if the key is an Ed25519 key, the `pubKeyPrefix` MUST be + * 32 bytes long and contain the full public key bytes.
+ * If the key is an ECDSA(secp256k1) key, the `pubKeyPrefix` MUST be + * 33 bytes long and contain the full _compressed_ form of the public key. + *
+ *

+ *

Purpose
+ *
The `pubKeyPrefix` exists to save cost. A signed transaction with + * shorter prefixes will have fewer bytes, and so will have a lower + * transaction fee. + * The prefixes, however, MUST be long enough to distinguish between all + * of the public keys that might be signing the transaction. Therefore, + * software signing a transaction SHOULD evaluate which keys might possibly + * be required to sign a transaction, and ensure that the shortest prefix + * that is sufficient to unambiguously identify the correct key is used. + *
+ * @member {Uint8Array} pubKeyPrefix + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.pubKeyPrefix = $util.newBuffer([]); + + /** + * A smart contract virtual signature. + *

+ * This value MUST be length zero, if set. + * @member {Uint8Array|null|undefined} contract + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.contract = null; + + /** + * An Ed25519 signature. + * @member {Uint8Array|null|undefined} ed25519 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ed25519 = null; + + /** + * This option is not supported.
+ * A RSA-3072 signature. + * @member {Uint8Array|null|undefined} RSA_3072 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.RSA_3072 = null; + + /** + * This option is not supported.
+ * ECDSA p-384 signature. + * @member {Uint8Array|null|undefined} ECDSA_384 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSA_384 = null; + + /** + * An ECDSA(secp256k1) signature. + * @member {Uint8Array|null|undefined} ECDSASecp256k1 + * @memberof proto.SignaturePair + * @instance + */ + SignaturePair.prototype.ECDSASecp256k1 = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * SignaturePair signature. + * @member {"contract"|"ed25519"|"RSA_3072"|"ECDSA_384"|"ECDSASecp256k1"|undefined} signature + * @memberof proto.SignaturePair + * @instance + */ + Object.defineProperty(SignaturePair.prototype, "signature", { + get: $util.oneOfGetter($oneOfFields = ["contract", "ed25519", "RSA_3072", "ECDSA_384", "ECDSASecp256k1"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignaturePair instance using the specified properties. + * @function create + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair=} [properties] Properties to set + * @returns {proto.SignaturePair} SignaturePair instance + */ + SignaturePair.create = function create(properties) { + return new SignaturePair(properties); + }; + + /** + * Encodes the specified SignaturePair message. Does not implicitly {@link proto.SignaturePair.verify|verify} messages. + * @function encode + * @memberof proto.SignaturePair + * @static + * @param {proto.ISignaturePair} m SignaturePair message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignaturePair.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.pubKeyPrefix != null && Object.hasOwnProperty.call(m, "pubKeyPrefix")) + w.uint32(10).bytes(m.pubKeyPrefix); + if (m.contract != null && Object.hasOwnProperty.call(m, "contract")) + w.uint32(18).bytes(m.contract); + if (m.ed25519 != null && Object.hasOwnProperty.call(m, "ed25519")) + w.uint32(26).bytes(m.ed25519); + if (m.RSA_3072 != null && Object.hasOwnProperty.call(m, "RSA_3072")) + w.uint32(34).bytes(m.RSA_3072); + if (m.ECDSA_384 != null && Object.hasOwnProperty.call(m, "ECDSA_384")) + w.uint32(42).bytes(m.ECDSA_384); + if (m.ECDSASecp256k1 != null && Object.hasOwnProperty.call(m, "ECDSASecp256k1")) + w.uint32(50).bytes(m.ECDSASecp256k1); + return w; + }; + + /** + * Decodes a SignaturePair message from the specified reader or buffer. + * @function decode + * @memberof proto.SignaturePair + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignaturePair} SignaturePair + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignaturePair.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignaturePair(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.pubKeyPrefix = r.bytes(); + break; + } + case 2: { + m.contract = r.bytes(); + break; + } + case 3: { + m.ed25519 = r.bytes(); + break; + } + case 4: { + m.RSA_3072 = r.bytes(); + break; + } + case 5: { + m.ECDSA_384 = r.bytes(); + break; + } + case 6: { + m.ECDSASecp256k1 = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignaturePair + * @function getTypeUrl + * @memberof proto.SignaturePair + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignaturePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignaturePair"; + }; + + return SignaturePair; + })(); + + proto.SignatureMap = (function() { + + /** + * Properties of a SignatureMap. + * @memberof proto + * @interface ISignatureMap + * @property {Array.|null} [sigPair] A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + */ + + /** + * Constructs a new SignatureMap. + * @memberof proto + * @classdesc A set of signatures corresponding to every unique public key that + * signed a given transaction. + * + * If any public key matches more than one prefix in the signature map, + * the transaction containing that map SHALL fail immediately with the + * response code `KEY_PREFIX_MISMATCH`. + * @implements ISignatureMap + * @constructor + * @param {proto.ISignatureMap=} [p] Properties to set + */ + function SignatureMap(p) { + this.sigPair = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of signature pairs for a specific transaction.
+ * Each signature pair represents a single cryptographic (`primitive`) + * public key identified by a "prefix" value and the cryptographic + * signature produced for that key. + * @member {Array.} sigPair + * @memberof proto.SignatureMap + * @instance + */ + SignatureMap.prototype.sigPair = $util.emptyArray; + + /** + * Creates a new SignatureMap instance using the specified properties. + * @function create + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap=} [properties] Properties to set + * @returns {proto.SignatureMap} SignatureMap instance + */ + SignatureMap.create = function create(properties) { + return new SignatureMap(properties); + }; + + /** + * Encodes the specified SignatureMap message. Does not implicitly {@link proto.SignatureMap.verify|verify} messages. + * @function encode + * @memberof proto.SignatureMap + * @static + * @param {proto.ISignatureMap} m SignatureMap message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignatureMap.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.sigPair != null && m.sigPair.length) { + for (var i = 0; i < m.sigPair.length; ++i) + $root.proto.SignaturePair.encode(m.sigPair[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a SignatureMap message from the specified reader or buffer. + * @function decode + * @memberof proto.SignatureMap + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SignatureMap} SignatureMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignatureMap.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SignatureMap(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.sigPair && m.sigPair.length)) + m.sigPair = []; + m.sigPair.push($root.proto.SignaturePair.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SignatureMap + * @function getTypeUrl + * @memberof proto.SignatureMap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignatureMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SignatureMap"; + }; + + return SignatureMap; + })(); + + /** + * The transactions and queries supported by Hedera Hashgraph. + * @name proto.HederaFunctionality + * @enum {number} + * @property {number} NONE=0 Unused - The first value is unused because this default value is + * ambiguous with an "unset" value and therefore should not be used. + * @property {number} CryptoTransfer=1 Transfer tokens among accounts. + * @property {number} CryptoUpdate=2 Update an account. + * @property {number} CryptoDelete=3 Delete an account. + * @property {number} CryptoAddLiveHash=4 Add a livehash to an account + * @property {number} CryptoDeleteLiveHash=5 Delete a livehash from an account + * @property {number} ContractCall=6 Execute a smart contract call. + * @property {number} ContractCreate=7 Create a smart contract. + * @property {number} ContractUpdate=8 Update a smart contract. + * @property {number} FileCreate=9 Create a "file" stored in the ledger. + * @property {number} FileAppend=10 Append data to a "file" stored in the ledger. + * @property {number} FileUpdate=11 Update a "file" stored in the ledger. + * @property {number} FileDelete=12 Delete a "file" stored in the ledger. + * @property {number} CryptoGetAccountBalance=13 Get the balance for an account. + * @property {number} CryptoGetAccountRecords=14 Get a full account record. + * @property {number} CryptoGetInfo=15 Get information about a token. + * @property {number} ContractCallLocal=16 Execute a local smart contract call.
+ * Used by contracts to call other contracts. + * @property {number} ContractGetInfo=17 Get information about a smart contract. + * @property {number} ContractGetBytecode=18 Get the compiled bytecode that implements a smart contract. + * @property {number} GetBySolidityID=19 Get a smart contract record by reference to the solidity ID. + * @property {number} GetByKey=20 Get a smart contract by reference to the contract key. + * @property {number} CryptoGetLiveHash=21 Get the live hash for an account + * @property {number} CryptoGetStakers=22 Get the accounts proxy staking to a given account. + * @property {number} FileGetContents=23 Get the contents of a "file" stored in the ledger. + * @property {number} FileGetInfo=24 Get the metadata for a "file" stored in the ledger. + * @property {number} TransactionGetRecord=25 Get transaction record(s) for a specified transaction ID. + * @property {number} ContractGetRecords=26 Get all transaction records for a specified contract ID in + * the past 24 hours.
+ * deprecated since version 0.9.0 + * @property {number} CryptoCreate=27 Create a new account + * @property {number} SystemDelete=28 Delete a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. + * @property {number} SystemUndelete=29 Undo the delete of a "system" "file" stored in the ledger.
+ * "System" files are files with special purpose and ID values within a + * specific range.
+ * These files require additional controls and can only be deleted when + * authorized by accounts with elevated privilege. This operation allows + * such files to be restored, within a reasonable timeframe, if + * deleted improperly. + * @property {number} ContractDelete=30 Delete a smart contract + * @property {number} Freeze=31 Stop all processing and "freeze" the entire network.
+ * This is generally sent immediately prior to upgrading the network.
+ * After processing this transactions all nodes enter a quiescent state. + * @property {number} CreateTransactionRecord=32 Create a Transaction Record.
+ * This appears to be purely internal and unused. + * @property {number} CryptoAccountAutoRenew=33 Auto-renew an account.
+ * This is used for internal fee calculations. + * @property {number} ContractAutoRenew=34 Auto-renew a smart contract.
+ * This is used for internal fee calculations. + * @property {number} GetVersionInfo=35 Get version information for the ledger.
+ * This returns a the version of the software currently running the network + * for both the protocol buffers and the network services (node). + * @property {number} TransactionGetReceipt=36 Get a receipt for a specified transaction ID. + * @property {number} ConsensusCreateTopic=50 Create a topic for the Hedera Consensus Service (HCS). + * @property {number} ConsensusUpdateTopic=51 Update an HCS topic. + * @property {number} ConsensusDeleteTopic=52 Delete an HCS topic. + * @property {number} ConsensusGetTopicInfo=53 Get metadata (information) for an HCS topic. + * @property {number} ConsensusSubmitMessage=54 Publish a message to an HCS topic. + * @property {number} UncheckedSubmit=55 Submit a transaction, bypassing intake checking. + * Only enabled in local-mode. + * @property {number} TokenCreate=56 Create a token for the Hedera Token Service (HTS). + * @property {number} TokenGetInfo=58 Get metadata (information) for an HTS token. + * @property {number} TokenFreezeAccount=59 Freeze a specific account with respect to a specific HTS token. + *

+ * Once this transaction completes that account CANNOT send or receive + * the specified token. + * @property {number} TokenUnfreezeAccount=60 Remove a "freeze" from an account with respect to a specific HTS token. + * @property {number} TokenGrantKycToAccount=61 Grant KYC status to an account for a specific HTS token. + * @property {number} TokenRevokeKycFromAccount=62 Revoke KYC status from an account for a specific HTS token. + * @property {number} TokenDelete=63 Delete a specific HTS token. + * @property {number} TokenUpdate=64 Update a specific HTS token. + * @property {number} TokenMint=65 Mint HTS token amounts to the treasury account for that token. + * @property {number} TokenBurn=66 Burn HTS token amounts from the treasury account for that token. + * @property {number} TokenAccountWipe=67 Wipe all amounts for a specific HTS token from a specified account. + * @property {number} TokenAssociateToAccount=68 Associate a specific HTS token to an account. + * @property {number} TokenDissociateFromAccount=69 Dissociate a specific HTS token from an account. + * @property {number} ScheduleCreate=70 Create a scheduled transaction + * @property {number} ScheduleDelete=71 Delete a scheduled transaction + * @property {number} ScheduleSign=72 Sign a scheduled transaction + * @property {number} ScheduleGetInfo=73 Get metadata (information) for a scheduled transaction + * @property {number} TokenGetAccountNftInfos=74 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token and owned by a specific account. + * @property {number} TokenGetNftInfo=75 Get metadata (information) for a specific NFT identified by token and + * serial number. + * @property {number} TokenGetNftInfos=76 Get NFT metadata (information) for a range of NFTs associated to a + * specific non-fungible/unique HTS token. + * @property {number} TokenFeeScheduleUpdate=77 Update a token's custom fee schedule. + *

+ * If a transaction of this type is not signed by the token + * `fee_schedule_key` it SHALL fail with INVALID_SIGNATURE, or + * TOKEN_HAS_NO_FEE_SCHEDULE_KEY if there is no `fee_schedule_key` set. + * @property {number} NetworkGetExecutionTime=78 Get execution time(s) for one or more "recent" TransactionIDs. + * @property {number} TokenPause=79 Pause a specific HTS token + * @property {number} TokenUnpause=80 Unpause a paused HTS token. + * @property {number} CryptoApproveAllowance=81 Approve an allowance for a spender relative to the owner account, which + * MUST sign the transaction. + * @property {number} CryptoDeleteAllowance=82 Delete (unapprove) an allowance previously approved + * for the owner account. + * @property {number} GetAccountDetails=83 Get all the information about an account, including balance + * and allowances.
+ * This does not get a list of account records. + * @property {number} EthereumTransaction=84 Perform an Ethereum (EVM) transaction.
+ * CallData may be inline if small, or in a "file" if large. + * @property {number} NodeStakeUpdate=85 Used to indicate when the network has updated the staking information + * at the end of a staking period and to indicate a new staking period + * has started. + * @property {number} UtilPrng=86 Generate and return a pseudorandom number based on network state. + * @property {number} TransactionGetFastRecord=87 Get a record for a "recent" transaction. + * @property {number} TokenUpdateNfts=88 Update the metadata of one or more NFT's of a specific token type. + * @property {number} NodeCreate=89 Create a node + * @property {number} NodeUpdate=90 Update a node + * @property {number} NodeDelete=91 Delete a node + * @property {number} TokenReject=92 Transfer one or more token balances held by the requesting account + * to the treasury for each token type. + * @property {number} TokenAirdrop=93 Airdrop one or more tokens to one or more accounts. + * @property {number} TokenCancelAirdrop=94 Remove one or more pending airdrops from state on behalf of + * the sender(s) for each airdrop. + * @property {number} TokenClaimAirdrop=95 Claim one or more pending airdrops + * @property {number} StateSignatureTransaction=100 Submit a signature of a state root hash gossiped to other nodes + * @property {number} HintsKeyPublication=101 Publish a hinTS key to the network. + * @property {number} HintsPreprocessingVote=102 Vote for a particular preprocessing output of a hinTS construction. + * @property {number} HintsPartialSignature=103 Sign a partial signature for the active hinTS construction. + * @property {number} HistoryAssemblySignature=104 Sign a particular history assembly. + * @property {number} HistoryProofKeyPublication=105 Publish a roster history proof key to the network. + * @property {number} HistoryProofVote=106 Vote for a particular history proof. + * @property {number} CrsPublication=107 Publish a random CRS to the network. + * @property {number} AtomicBatch=108 Submit a batch of transactions to run atomically + */ + proto.HederaFunctionality = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "CryptoTransfer"] = 1; + values[valuesById[2] = "CryptoUpdate"] = 2; + values[valuesById[3] = "CryptoDelete"] = 3; + values[valuesById[4] = "CryptoAddLiveHash"] = 4; + values[valuesById[5] = "CryptoDeleteLiveHash"] = 5; + values[valuesById[6] = "ContractCall"] = 6; + values[valuesById[7] = "ContractCreate"] = 7; + values[valuesById[8] = "ContractUpdate"] = 8; + values[valuesById[9] = "FileCreate"] = 9; + values[valuesById[10] = "FileAppend"] = 10; + values[valuesById[11] = "FileUpdate"] = 11; + values[valuesById[12] = "FileDelete"] = 12; + values[valuesById[13] = "CryptoGetAccountBalance"] = 13; + values[valuesById[14] = "CryptoGetAccountRecords"] = 14; + values[valuesById[15] = "CryptoGetInfo"] = 15; + values[valuesById[16] = "ContractCallLocal"] = 16; + values[valuesById[17] = "ContractGetInfo"] = 17; + values[valuesById[18] = "ContractGetBytecode"] = 18; + values[valuesById[19] = "GetBySolidityID"] = 19; + values[valuesById[20] = "GetByKey"] = 20; + values[valuesById[21] = "CryptoGetLiveHash"] = 21; + values[valuesById[22] = "CryptoGetStakers"] = 22; + values[valuesById[23] = "FileGetContents"] = 23; + values[valuesById[24] = "FileGetInfo"] = 24; + values[valuesById[25] = "TransactionGetRecord"] = 25; + values[valuesById[26] = "ContractGetRecords"] = 26; + values[valuesById[27] = "CryptoCreate"] = 27; + values[valuesById[28] = "SystemDelete"] = 28; + values[valuesById[29] = "SystemUndelete"] = 29; + values[valuesById[30] = "ContractDelete"] = 30; + values[valuesById[31] = "Freeze"] = 31; + values[valuesById[32] = "CreateTransactionRecord"] = 32; + values[valuesById[33] = "CryptoAccountAutoRenew"] = 33; + values[valuesById[34] = "ContractAutoRenew"] = 34; + values[valuesById[35] = "GetVersionInfo"] = 35; + values[valuesById[36] = "TransactionGetReceipt"] = 36; + values[valuesById[50] = "ConsensusCreateTopic"] = 50; + values[valuesById[51] = "ConsensusUpdateTopic"] = 51; + values[valuesById[52] = "ConsensusDeleteTopic"] = 52; + values[valuesById[53] = "ConsensusGetTopicInfo"] = 53; + values[valuesById[54] = "ConsensusSubmitMessage"] = 54; + values[valuesById[55] = "UncheckedSubmit"] = 55; + values[valuesById[56] = "TokenCreate"] = 56; + values[valuesById[58] = "TokenGetInfo"] = 58; + values[valuesById[59] = "TokenFreezeAccount"] = 59; + values[valuesById[60] = "TokenUnfreezeAccount"] = 60; + values[valuesById[61] = "TokenGrantKycToAccount"] = 61; + values[valuesById[62] = "TokenRevokeKycFromAccount"] = 62; + values[valuesById[63] = "TokenDelete"] = 63; + values[valuesById[64] = "TokenUpdate"] = 64; + values[valuesById[65] = "TokenMint"] = 65; + values[valuesById[66] = "TokenBurn"] = 66; + values[valuesById[67] = "TokenAccountWipe"] = 67; + values[valuesById[68] = "TokenAssociateToAccount"] = 68; + values[valuesById[69] = "TokenDissociateFromAccount"] = 69; + values[valuesById[70] = "ScheduleCreate"] = 70; + values[valuesById[71] = "ScheduleDelete"] = 71; + values[valuesById[72] = "ScheduleSign"] = 72; + values[valuesById[73] = "ScheduleGetInfo"] = 73; + values[valuesById[74] = "TokenGetAccountNftInfos"] = 74; + values[valuesById[75] = "TokenGetNftInfo"] = 75; + values[valuesById[76] = "TokenGetNftInfos"] = 76; + values[valuesById[77] = "TokenFeeScheduleUpdate"] = 77; + values[valuesById[78] = "NetworkGetExecutionTime"] = 78; + values[valuesById[79] = "TokenPause"] = 79; + values[valuesById[80] = "TokenUnpause"] = 80; + values[valuesById[81] = "CryptoApproveAllowance"] = 81; + values[valuesById[82] = "CryptoDeleteAllowance"] = 82; + values[valuesById[83] = "GetAccountDetails"] = 83; + values[valuesById[84] = "EthereumTransaction"] = 84; + values[valuesById[85] = "NodeStakeUpdate"] = 85; + values[valuesById[86] = "UtilPrng"] = 86; + values[valuesById[87] = "TransactionGetFastRecord"] = 87; + values[valuesById[88] = "TokenUpdateNfts"] = 88; + values[valuesById[89] = "NodeCreate"] = 89; + values[valuesById[90] = "NodeUpdate"] = 90; + values[valuesById[91] = "NodeDelete"] = 91; + values[valuesById[92] = "TokenReject"] = 92; + values[valuesById[93] = "TokenAirdrop"] = 93; + values[valuesById[94] = "TokenCancelAirdrop"] = 94; + values[valuesById[95] = "TokenClaimAirdrop"] = 95; + values[valuesById[100] = "StateSignatureTransaction"] = 100; + values[valuesById[101] = "HintsKeyPublication"] = 101; + values[valuesById[102] = "HintsPreprocessingVote"] = 102; + values[valuesById[103] = "HintsPartialSignature"] = 103; + values[valuesById[104] = "HistoryAssemblySignature"] = 104; + values[valuesById[105] = "HistoryProofKeyPublication"] = 105; + values[valuesById[106] = "HistoryProofVote"] = 106; + values[valuesById[107] = "CrsPublication"] = 107; + values[valuesById[108] = "AtomicBatch"] = 108; + return values; + })(); + + proto.FeeComponents = (function() { + + /** + * Properties of a FeeComponents. + * @memberof proto + * @interface IFeeComponents + * @property {Long|null} [min] Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @property {Long|null} [max] Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @property {Long|null} [constant] Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @property {Long|null} [bpt] Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @property {Long|null} [vpt] Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @property {Long|null} [rbh] Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @property {Long|null} [sbh] Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @property {Long|null} [gas] Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @property {Long|null} [tv] Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @property {Long|null} [bpr] Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @property {Long|null} [sbpr] Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + */ + + /** + * Constructs a new FeeComponents. + * @memberof proto + * @classdesc A set of values the nodes use in determining transaction and query fees, and + * constants involved in fee calculations. + * + * Nodes SHALL multiply the amount of "resources" allocated to a transaction or + * query by the corresponding price to calculate the appropriate fee. Units are + * one-thousandth of a `tinyCent`. The "resource" allocations SHALL be estimated + * based on transaction characteristics and current network state, and MAY be + * further adjusted based on network load and congestion. + * + * This SHALL be used, in different contexts, for the cost _factors_ used to + * calculate charged amounts, for the resource accumulation, and for actual + * amounts to be charged.
+ * Amounts recorded here MUST be converted to tinybar according to the + * current active `ExchangeRate` for the network. + * @implements IFeeComponents + * @constructor + * @param {proto.IFeeComponents=} [p] Properties to set + */ + function FeeComponents(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Base: "minimum total fee". + *

+ * The calculated fee MUST be greater than this value. + * @member {Long} min + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.min = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "maximum total fee". + *

+ * The calculated fee MUST be less than this value. + * @member {Long} max + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.max = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Base: "constant fee".
+ * A baseline constant contribution to total fee. + * @member {Long} constant + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.constant = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Bandwidth: "bytes per transaction".
+ * The fee for bandwidth consumed by a transaction, measured in bytes + * @member {Long} bpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Signatures: "validations per transaction".
+ * The fee for signature verifications required by a transaction + * @member {Long} vpt + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.vpt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Memory: "RAM byte-hours".
+ * The fee for RAM required to process a transaction, + * measured in byte-hours + * @member {Long} rbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.rbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Disk: "storage byte-hours".
+ * The fee for storage required by a transaction, measured in byte-hours + * @member {Long} sbh + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbh = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Compute: Ethereum term for a derivative EVM compute resource.
+ * The fee of computation for a smart contract transaction. The value of + * gas is set by a conversion rate, and is regularly updated to reflect + * reasonable and customary costs. + * @member {Long} gas + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.gas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Ad valorem: "transferred value".
+ * The fee for HBAR transferred by a transaction. + * @member {Long} tv + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.tv = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response memory: "bytes per response".
+ * The fee for data retrieved from memory to deliver a response, + * measured in bytes + * @member {Long} bpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.bpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Response disk: "storage bytes per response".
+ * The fee for data retrieved from disk to deliver a response, + * measured in bytes + * @member {Long} sbpr + * @memberof proto.FeeComponents + * @instance + */ + FeeComponents.prototype.sbpr = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new FeeComponents instance using the specified properties. + * @function create + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents=} [properties] Properties to set + * @returns {proto.FeeComponents} FeeComponents instance + */ + FeeComponents.create = function create(properties) { + return new FeeComponents(properties); + }; + + /** + * Encodes the specified FeeComponents message. Does not implicitly {@link proto.FeeComponents.verify|verify} messages. + * @function encode + * @memberof proto.FeeComponents + * @static + * @param {proto.IFeeComponents} m FeeComponents message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeComponents.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.min != null && Object.hasOwnProperty.call(m, "min")) + w.uint32(8).int64(m.min); + if (m.max != null && Object.hasOwnProperty.call(m, "max")) + w.uint32(16).int64(m.max); + if (m.constant != null && Object.hasOwnProperty.call(m, "constant")) + w.uint32(24).int64(m.constant); + if (m.bpt != null && Object.hasOwnProperty.call(m, "bpt")) + w.uint32(32).int64(m.bpt); + if (m.vpt != null && Object.hasOwnProperty.call(m, "vpt")) + w.uint32(40).int64(m.vpt); + if (m.rbh != null && Object.hasOwnProperty.call(m, "rbh")) + w.uint32(48).int64(m.rbh); + if (m.sbh != null && Object.hasOwnProperty.call(m, "sbh")) + w.uint32(56).int64(m.sbh); + if (m.gas != null && Object.hasOwnProperty.call(m, "gas")) + w.uint32(64).int64(m.gas); + if (m.tv != null && Object.hasOwnProperty.call(m, "tv")) + w.uint32(72).int64(m.tv); + if (m.bpr != null && Object.hasOwnProperty.call(m, "bpr")) + w.uint32(80).int64(m.bpr); + if (m.sbpr != null && Object.hasOwnProperty.call(m, "sbpr")) + w.uint32(88).int64(m.sbpr); + return w; + }; + + /** + * Decodes a FeeComponents message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeComponents + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeComponents} FeeComponents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeComponents.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeComponents(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.min = r.int64(); + break; + } + case 2: { + m.max = r.int64(); + break; + } + case 3: { + m.constant = r.int64(); + break; + } + case 4: { + m.bpt = r.int64(); + break; + } + case 5: { + m.vpt = r.int64(); + break; + } + case 6: { + m.rbh = r.int64(); + break; + } + case 7: { + m.sbh = r.int64(); + break; + } + case 8: { + m.gas = r.int64(); + break; + } + case 9: { + m.tv = r.int64(); + break; + } + case 10: { + m.bpr = r.int64(); + break; + } + case 11: { + m.sbpr = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeComponents + * @function getTypeUrl + * @memberof proto.FeeComponents + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeComponents.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeComponents"; + }; + + return FeeComponents; + })(); + + proto.TransactionFeeSchedule = (function() { + + /** + * Properties of a TransactionFeeSchedule. + * @memberof proto + * @interface ITransactionFeeSchedule + * @property {proto.HederaFunctionality|null} [hederaFunctionality] An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @property {proto.IFeeData|null} [feeData] Use `fees` instead of this field.
+ * Resource price coefficients. + * @property {Array.|null} [fees] The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + */ + + /** + * Constructs a new TransactionFeeSchedule. + * @memberof proto + * @classdesc The fee schedule for a specific transaction or query based on the fee data. + * @implements ITransactionFeeSchedule + * @constructor + * @param {proto.ITransactionFeeSchedule=} [p] Properties to set + */ + function TransactionFeeSchedule(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An enumeration for a particular transaction or query.
+ * The functionality type determines the base cost parameters. + * @member {proto.HederaFunctionality} hederaFunctionality + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.hederaFunctionality = 0; + + /** + * Use `fees` instead of this field.
+ * Resource price coefficients. + * @member {proto.IFeeData|null|undefined} feeData + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.feeData = null; + + /** + * The resource price coefficients for transaction type and any applicable + * subtypes.
+ * The multiple entries enable support for subtype price definitions. + * @member {Array.} fees + * @memberof proto.TransactionFeeSchedule + * @instance + */ + TransactionFeeSchedule.prototype.fees = $util.emptyArray; + + /** + * Creates a new TransactionFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule=} [properties] Properties to set + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule instance + */ + TransactionFeeSchedule.create = function create(properties) { + return new TransactionFeeSchedule(properties); + }; + + /** + * Encodes the specified TransactionFeeSchedule message. Does not implicitly {@link proto.TransactionFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {proto.ITransactionFeeSchedule} m TransactionFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.hederaFunctionality != null && Object.hasOwnProperty.call(m, "hederaFunctionality")) + w.uint32(8).int32(m.hederaFunctionality); + if (m.feeData != null && Object.hasOwnProperty.call(m, "feeData")) + $root.proto.FeeData.encode(m.feeData, w.uint32(18).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FeeData.encode(m.fees[i], w.uint32(26).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TransactionFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.TransactionFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TransactionFeeSchedule} TransactionFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TransactionFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.hederaFunctionality = r.int32(); + break; + } + case 2: { + m.feeData = $root.proto.FeeData.decode(r, r.uint32()); + break; + } + case 3: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FeeData.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TransactionFeeSchedule + * @function getTypeUrl + * @memberof proto.TransactionFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TransactionFeeSchedule"; + }; + + return TransactionFeeSchedule; + })(); + + proto.FeeData = (function() { + + /** + * Properties of a FeeData. + * @memberof proto + * @interface IFeeData + * @property {proto.IFeeComponents|null} [nodedata] Fee components to be paid to the submitting node. + * @property {proto.IFeeComponents|null} [networkdata] Fee components to be paid to the network for bringing a + * transaction to consensus. + * @property {proto.IFeeComponents|null} [servicedata] Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @property {proto.SubType|null} [subType] A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + */ + + /** + * Constructs a new FeeData. + * @memberof proto + * @classdesc A total fee, in component amounts charged for a transaction. + * + * Total fees are composed of three sets of components. + * - Node data, components that compensate the specific node that submitted + * the transaction. + * - Network data, components that compensate the Hedera network for gossiping + * the transaction and determining the consensus timestamp. + * - Service data, components that compensate the Hedera network for the ongoing + * maintenance and operation of the network, as well as ongoing development + * of network services. + * + * Fee components are recorded in thousandths of a tiny cent, and the network + * exchange rate converts these to tinybar amounts, which are what the network + * charges for transactions and what the network reports in the record stream. + * @implements IFeeData + * @constructor + * @param {proto.IFeeData=} [p] Properties to set + */ + function FeeData(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Fee components to be paid to the submitting node. + * @member {proto.IFeeComponents|null|undefined} nodedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.nodedata = null; + + /** + * Fee components to be paid to the network for bringing a + * transaction to consensus. + * @member {proto.IFeeComponents|null|undefined} networkdata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.networkdata = null; + + /** + * Fee components to be paid to the network for providing the immediate and + * ongoing services associated with executing the transaction, maintaining + * the network, and developing the network software. + * @member {proto.IFeeComponents|null|undefined} servicedata + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.servicedata = null; + + /** + * A sub-type distinguishing between different types of `FeeData` that may + * apply to the same base transaction type (associated with + * an `HederaFunctionality`). + * @member {proto.SubType} subType + * @memberof proto.FeeData + * @instance + */ + FeeData.prototype.subType = 0; + + /** + * Creates a new FeeData instance using the specified properties. + * @function create + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData=} [properties] Properties to set + * @returns {proto.FeeData} FeeData instance + */ + FeeData.create = function create(properties) { + return new FeeData(properties); + }; + + /** + * Encodes the specified FeeData message. Does not implicitly {@link proto.FeeData.verify|verify} messages. + * @function encode + * @memberof proto.FeeData + * @static + * @param {proto.IFeeData} m FeeData message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeData.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodedata != null && Object.hasOwnProperty.call(m, "nodedata")) + $root.proto.FeeComponents.encode(m.nodedata, w.uint32(10).fork()).ldelim(); + if (m.networkdata != null && Object.hasOwnProperty.call(m, "networkdata")) + $root.proto.FeeComponents.encode(m.networkdata, w.uint32(18).fork()).ldelim(); + if (m.servicedata != null && Object.hasOwnProperty.call(m, "servicedata")) + $root.proto.FeeComponents.encode(m.servicedata, w.uint32(26).fork()).ldelim(); + if (m.subType != null && Object.hasOwnProperty.call(m, "subType")) + w.uint32(32).int32(m.subType); + return w; + }; + + /** + * Decodes a FeeData message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeData + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeData} FeeData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeData.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeData(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.nodedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 2: { + m.networkdata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 3: { + m.servicedata = $root.proto.FeeComponents.decode(r, r.uint32()); + break; + } + case 4: { + m.subType = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeData + * @function getTypeUrl + * @memberof proto.FeeData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeData"; + }; + + return FeeData; + })(); + + proto.FeeSchedule = (function() { + + /** + * Properties of a FeeSchedule. + * @memberof proto + * @interface IFeeSchedule + * @property {Array.|null} [transactionFeeSchedule] Sets of fee coefficients for various transaction or query types. + * @property {proto.ITimestampSeconds|null} [expiryTime] A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + */ + + /** + * Constructs a new FeeSchedule. + * @memberof proto + * @classdesc A set of fee schedules covering all transaction types and query types, along + * with a specific time at which this fee schedule will expire. + * + * Nodes SHALL use the most recent unexpired fee schedule to determine the fees + * for all transactions based on various resource components imputed to each + * transaction. + * @implements IFeeSchedule + * @constructor + * @param {proto.IFeeSchedule=} [p] Properties to set + */ + function FeeSchedule(p) { + this.transactionFeeSchedule = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Sets of fee coefficients for various transaction or query types. + * @member {Array.} transactionFeeSchedule + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.transactionFeeSchedule = $util.emptyArray; + + /** + * A time, in seconds since the `epoch`, when this fee schedule + * will expire. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch + * with 0 at `1970-01-01T00:00:00.000Z`. + * @member {proto.ITimestampSeconds|null|undefined} expiryTime + * @memberof proto.FeeSchedule + * @instance + */ + FeeSchedule.prototype.expiryTime = null; + + /** + * Creates a new FeeSchedule instance using the specified properties. + * @function create + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule=} [properties] Properties to set + * @returns {proto.FeeSchedule} FeeSchedule instance + */ + FeeSchedule.create = function create(properties) { + return new FeeSchedule(properties); + }; + + /** + * Encodes the specified FeeSchedule message. Does not implicitly {@link proto.FeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.FeeSchedule + * @static + * @param {proto.IFeeSchedule} m FeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.transactionFeeSchedule != null && m.transactionFeeSchedule.length) { + for (var i = 0; i < m.transactionFeeSchedule.length; ++i) + $root.proto.TransactionFeeSchedule.encode(m.transactionFeeSchedule[i], w.uint32(10).fork()).ldelim(); + } + if (m.expiryTime != null && Object.hasOwnProperty.call(m, "expiryTime")) + $root.proto.TimestampSeconds.encode(m.expiryTime, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeSchedule} FeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.transactionFeeSchedule && m.transactionFeeSchedule.length)) + m.transactionFeeSchedule = []; + m.transactionFeeSchedule.push($root.proto.TransactionFeeSchedule.decode(r, r.uint32())); + break; + } + case 2: { + m.expiryTime = $root.proto.TimestampSeconds.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeSchedule + * @function getTypeUrl + * @memberof proto.FeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeSchedule"; + }; + + return FeeSchedule; + })(); + + proto.CurrentAndNextFeeSchedule = (function() { + + /** + * Properties of a CurrentAndNextFeeSchedule. + * @memberof proto + * @interface ICurrentAndNextFeeSchedule + * @property {proto.IFeeSchedule|null} [currentFeeSchedule] A current, unexpired, fee schedule. + * @property {proto.IFeeSchedule|null} [nextFeeSchedule] A future fee schedule to use when the current schedule expires. + */ + + /** + * Constructs a new CurrentAndNextFeeSchedule. + * @memberof proto + * @classdesc The "current" fee schedule and the "next" fee schedule. + * + * The current fee schedule is the schedule that SHALL apply to the current + * transaction.
+ * The next fee schedule is the schedule that SHALL apply after the current + * schedule expires.
+ * We store both to avoid a condition where transactions are processed very + * near the time when a fee schedule expires and it might be indeterminate + * which fees to apply. With both current and next fee schedule the network + * can deterministically apply the correct fee schedule based on consensus + * timestamp for each transaction. + * @implements ICurrentAndNextFeeSchedule + * @constructor + * @param {proto.ICurrentAndNextFeeSchedule=} [p] Properties to set + */ + function CurrentAndNextFeeSchedule(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A current, unexpired, fee schedule. + * @member {proto.IFeeSchedule|null|undefined} currentFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.currentFeeSchedule = null; + + /** + * A future fee schedule to use when the current schedule expires. + * @member {proto.IFeeSchedule|null|undefined} nextFeeSchedule + * @memberof proto.CurrentAndNextFeeSchedule + * @instance + */ + CurrentAndNextFeeSchedule.prototype.nextFeeSchedule = null; + + /** + * Creates a new CurrentAndNextFeeSchedule instance using the specified properties. + * @function create + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule=} [properties] Properties to set + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule instance + */ + CurrentAndNextFeeSchedule.create = function create(properties) { + return new CurrentAndNextFeeSchedule(properties); + }; + + /** + * Encodes the specified CurrentAndNextFeeSchedule message. Does not implicitly {@link proto.CurrentAndNextFeeSchedule.verify|verify} messages. + * @function encode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {proto.ICurrentAndNextFeeSchedule} m CurrentAndNextFeeSchedule message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentAndNextFeeSchedule.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.currentFeeSchedule != null && Object.hasOwnProperty.call(m, "currentFeeSchedule")) + $root.proto.FeeSchedule.encode(m.currentFeeSchedule, w.uint32(10).fork()).ldelim(); + if (m.nextFeeSchedule != null && Object.hasOwnProperty.call(m, "nextFeeSchedule")) + $root.proto.FeeSchedule.encode(m.nextFeeSchedule, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a CurrentAndNextFeeSchedule message from the specified reader or buffer. + * @function decode + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CurrentAndNextFeeSchedule} CurrentAndNextFeeSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentAndNextFeeSchedule.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CurrentAndNextFeeSchedule(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.currentFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + case 2: { + m.nextFeeSchedule = $root.proto.FeeSchedule.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CurrentAndNextFeeSchedule + * @function getTypeUrl + * @memberof proto.CurrentAndNextFeeSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentAndNextFeeSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CurrentAndNextFeeSchedule"; + }; + + return CurrentAndNextFeeSchedule; + })(); + + proto.ServiceEndpoint = (function() { + + /** + * Properties of a ServiceEndpoint. + * @memberof proto + * @interface IServiceEndpoint + * @property {Uint8Array|null} [ipAddressV4] A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @property {number|null} [port] A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @property {string|null} [domainName] A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + */ + + /** + * Constructs a new ServiceEndpoint. + * @memberof proto + * @classdesc A network node endpoint.
+ * Each network node in the global address book publishes one or more endpoints + * which enable the nodes to communicate both with other nodes, for gossip, and + * with clients to receive transaction requests. + * + * This message supports IPv4 with address and TCP port, + * and MAY include a FQDN instead of an IP address.
+ * IPv6 is not currently supported. + * + * When the `domain_name` field is set, the `ipAddressV4` field + * MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` field + * MUST NOT be set. + * @implements IServiceEndpoint + * @constructor + * @param {proto.IServiceEndpoint=} [p] Properties to set + */ + function ServiceEndpoint(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A 32-bit IPv4 address.
+ * This is the address of the endpoint, encoded in pure "big-endian" + * (i.e. left to right) order (e.g. `127.0.0.1` has hex bytes in the + * order `7F`, `00`, `00`, `01`). + * @member {Uint8Array} ipAddressV4 + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.ipAddressV4 = $util.newBuffer([]); + + /** + * A TCP port to use. + *

+ * This value MUST be between 0 and 65535, inclusive. + * @member {number} port + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.port = 0; + + /** + * A node domain name. + *

+ * This MUST be the fully qualified domain name of the node.
+ * This value MUST NOT exceed 253 characters.
+ * When the `domain_name` field is set, the `ipAddressV4` + * field MUST NOT be set.
+ * When the `ipAddressV4` field is set, the `domain_name` + * field MUST NOT be set. + * @member {string} domainName + * @memberof proto.ServiceEndpoint + * @instance + */ + ServiceEndpoint.prototype.domainName = ""; + + /** + * Creates a new ServiceEndpoint instance using the specified properties. + * @function create + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint=} [properties] Properties to set + * @returns {proto.ServiceEndpoint} ServiceEndpoint instance + */ + ServiceEndpoint.create = function create(properties) { + return new ServiceEndpoint(properties); + }; + + /** + * Encodes the specified ServiceEndpoint message. Does not implicitly {@link proto.ServiceEndpoint.verify|verify} messages. + * @function encode + * @memberof proto.ServiceEndpoint + * @static + * @param {proto.IServiceEndpoint} m ServiceEndpoint message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceEndpoint.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddressV4 != null && Object.hasOwnProperty.call(m, "ipAddressV4")) + w.uint32(10).bytes(m.ipAddressV4); + if (m.port != null && Object.hasOwnProperty.call(m, "port")) + w.uint32(16).int32(m.port); + if (m.domainName != null && Object.hasOwnProperty.call(m, "domainName")) + w.uint32(26).string(m.domainName); + return w; + }; + + /** + * Decodes a ServiceEndpoint message from the specified reader or buffer. + * @function decode + * @memberof proto.ServiceEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServiceEndpoint} ServiceEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceEndpoint.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServiceEndpoint(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddressV4 = r.bytes(); + break; + } + case 2: { + m.port = r.int32(); + break; + } + case 3: { + m.domainName = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServiceEndpoint + * @function getTypeUrl + * @memberof proto.ServiceEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServiceEndpoint"; + }; + + return ServiceEndpoint; + })(); + + proto.NodeAddress = (function() { + + /** + * Properties of a NodeAddress. + * @memberof proto + * @interface INodeAddress + * @property {Uint8Array|null} [ipAddress] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @property {number|null} [portno] ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @property {Uint8Array|null} [memo] Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @property {string|null} [RSA_PubKey] A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @property {Long|null} [nodeId] A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @property {proto.IAccountID|null} [nodeAccountId] An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @property {Uint8Array|null} [nodeCertHash] A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @property {Array.|null} [serviceEndpoint] A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @property {string|null} [description] A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @property {Long|null} [stake] This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + */ + + /** + * Constructs a new NodeAddress. + * @memberof proto + * @classdesc 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). + * + * All active fields are populated in the `0.0.102` address book file.
+ * Only fields documented with "`0.0.101` field" are populated in the 0.0.101 + * address book file. + * + * This message MAY be superseded by messages in state/addressbook/node.proto + * and node_get_info.proto. + * @implements INodeAddress + * @constructor + * @param {proto.INodeAddress=} [p] Properties to set + */ + function NodeAddress(p) { + this.serviceEndpoint = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The IP address of the Node, as a string, encoded in UTF-8.
+ * This value SHALL NOT be populated. + * @member {Uint8Array} ipAddress + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.ipAddress = $util.newBuffer([]); + + /** + * ServiceEndpoint is now used to retrieve a node's list of IP + * addresses and ports.
+ * The port number of the grpc server for the node.
+ * This value SHALL NOT be populated. + * @member {number} portno + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.portno = 0; + + /** + * Description provides short text functionality.
+ * A short description of the node. + *

+ * This field SHALL NOT be populated. + * @member {Uint8Array} memo + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.memo = $util.newBuffer([]); + + /** + * A hexadecimal String encoding of an X509 public key. + *

+ * This X509 RSA _public_ key SHALL be used to verify record stream files + * (e.g., record stream files).
+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form the public key DER encoding. + * @member {string} RSA_PubKey + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.RSA_PubKey = ""; + + /** + * A numeric identifier for the node. + *

+ * This value SHALL NOT be sequential. + *

+ * A `0.0.101` field + * @member {Long} nodeId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * An account to be paid the "node" portion of transaction fees.
+ * The "node" fees are paid to the node that submitted the transaction. + *

+ * A `0.0.101` field + * @member {proto.IAccountID|null|undefined} nodeAccountId + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeAccountId = null; + + /** + * A hash of the node's TLS certificate. + *

+ * This field SHALL be a string of hexadecimal characters, encoded UTF-8, + * which, translated to binary, form a SHA-384 hash of the node's TLS + * certificate in PEM format. + * This TLS certificate MUST be encoded UTF-8 and normalized according to + * the NFKD form prior to computing the hash value.
+ * The value of this field SHALL be used to verify the node TLS + * certificate when presented during protocol negotiation. + *

+ * A `0.0.101` field + * @member {Uint8Array} nodeCertHash + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.nodeCertHash = $util.newBuffer([]); + + /** + * A node's service IP addresses and TCP ports.
+ * Nodes require multiple endpoints to ensure that inter-node communication + * (e.g. gossip) is properly separated from client communication to + * API endpoints. + *

+ * A `0.0.101` field + * @member {Array.} serviceEndpoint + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.serviceEndpoint = $util.emptyArray; + + /** + * A short description of the node. + *

+ * This value, if set, MUST NOT exceed `transaction.maxMemoUtf8Bytes` + * (default 100) bytes when encoded as UTF-8. + * @member {string} description + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.description = ""; + + /** + * This is replaced by per-account stake tracking and dynamic + * calculation.
+ * The amount of tinybar staked to the node.
+ * This value SHOULD NOT be populated, and SHALL be ignored. + * @member {Long} stake + * @memberof proto.NodeAddress + * @instance + */ + NodeAddress.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NodeAddress instance using the specified properties. + * @function create + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress=} [properties] Properties to set + * @returns {proto.NodeAddress} NodeAddress instance + */ + NodeAddress.create = function create(properties) { + return new NodeAddress(properties); + }; + + /** + * Encodes the specified NodeAddress message. Does not implicitly {@link proto.NodeAddress.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddress + * @static + * @param {proto.INodeAddress} m NodeAddress message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddress.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.ipAddress != null && Object.hasOwnProperty.call(m, "ipAddress")) + w.uint32(10).bytes(m.ipAddress); + if (m.portno != null && Object.hasOwnProperty.call(m, "portno")) + w.uint32(16).int32(m.portno); + if (m.memo != null && Object.hasOwnProperty.call(m, "memo")) + w.uint32(26).bytes(m.memo); + if (m.RSA_PubKey != null && Object.hasOwnProperty.call(m, "RSA_PubKey")) + w.uint32(34).string(m.RSA_PubKey); + if (m.nodeId != null && Object.hasOwnProperty.call(m, "nodeId")) + w.uint32(40).int64(m.nodeId); + if (m.nodeAccountId != null && Object.hasOwnProperty.call(m, "nodeAccountId")) + $root.proto.AccountID.encode(m.nodeAccountId, w.uint32(50).fork()).ldelim(); + if (m.nodeCertHash != null && Object.hasOwnProperty.call(m, "nodeCertHash")) + w.uint32(58).bytes(m.nodeCertHash); + if (m.serviceEndpoint != null && m.serviceEndpoint.length) { + for (var i = 0; i < m.serviceEndpoint.length; ++i) + $root.proto.ServiceEndpoint.encode(m.serviceEndpoint[i], w.uint32(66).fork()).ldelim(); + } + if (m.description != null && Object.hasOwnProperty.call(m, "description")) + w.uint32(74).string(m.description); + if (m.stake != null && Object.hasOwnProperty.call(m, "stake")) + w.uint32(80).int64(m.stake); + return w; + }; + + /** + * Decodes a NodeAddress message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddress + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddress} NodeAddress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddress.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddress(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.ipAddress = r.bytes(); + break; + } + case 2: { + m.portno = r.int32(); + break; + } + case 3: { + m.memo = r.bytes(); + break; + } + case 4: { + m.RSA_PubKey = r.string(); + break; + } + case 5: { + m.nodeId = r.int64(); + break; + } + case 6: { + m.nodeAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 7: { + m.nodeCertHash = r.bytes(); + break; + } + case 8: { + if (!(m.serviceEndpoint && m.serviceEndpoint.length)) + m.serviceEndpoint = []; + m.serviceEndpoint.push($root.proto.ServiceEndpoint.decode(r, r.uint32())); + break; + } + case 9: { + m.description = r.string(); + break; + } + case 10: { + m.stake = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddress + * @function getTypeUrl + * @memberof proto.NodeAddress + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddress"; + }; + + return NodeAddress; + })(); + + proto.NodeAddressBook = (function() { + + /** + * Properties of a NodeAddressBook. + * @memberof proto + * @interface INodeAddressBook + * @property {Array.|null} [nodeAddress] Published data for all nodes in the network + */ + + /** + * Constructs a new NodeAddressBook. + * @memberof proto + * @classdesc A list of nodes and their metadata that contains details of the nodes + * running the network. + * + * Used to parse the contents of system files `0.0.101` and `0.0.102`. + * @implements INodeAddressBook + * @constructor + * @param {proto.INodeAddressBook=} [p] Properties to set + */ + function NodeAddressBook(p) { + this.nodeAddress = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * Published data for all nodes in the network + * @member {Array.} nodeAddress + * @memberof proto.NodeAddressBook + * @instance + */ + NodeAddressBook.prototype.nodeAddress = $util.emptyArray; + + /** + * Creates a new NodeAddressBook instance using the specified properties. + * @function create + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook=} [properties] Properties to set + * @returns {proto.NodeAddressBook} NodeAddressBook instance + */ + NodeAddressBook.create = function create(properties) { + return new NodeAddressBook(properties); + }; + + /** + * Encodes the specified NodeAddressBook message. Does not implicitly {@link proto.NodeAddressBook.verify|verify} messages. + * @function encode + * @memberof proto.NodeAddressBook + * @static + * @param {proto.INodeAddressBook} m NodeAddressBook message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAddressBook.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nodeAddress != null && m.nodeAddress.length) { + for (var i = 0; i < m.nodeAddress.length; ++i) + $root.proto.NodeAddress.encode(m.nodeAddress[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a NodeAddressBook message from the specified reader or buffer. + * @function decode + * @memberof proto.NodeAddressBook + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.NodeAddressBook} NodeAddressBook + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAddressBook.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.NodeAddressBook(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nodeAddress && m.nodeAddress.length)) + m.nodeAddress = []; + m.nodeAddress.push($root.proto.NodeAddress.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for NodeAddressBook + * @function getTypeUrl + * @memberof proto.NodeAddressBook + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAddressBook.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.NodeAddressBook"; + }; + + return NodeAddressBook; + })(); + + proto.SemanticVersion = (function() { + + /** + * Properties of a SemanticVersion. + * @memberof proto + * @interface ISemanticVersion + * @property {number|null} [major] A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @property {number|null} [minor] A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @property {number|null} [patch] A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @property {string|null} [pre] A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @property {string|null} [build] A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + */ + + /** + * Constructs a new SemanticVersion. + * @memberof proto + * @classdesc A software version according to "[semantic versioning](https://semver.org/)" + * or "date versioning". + * + * Hedera currently modifies the "typical" semantic versioning somewhat, the + * `major` version is always `0`, and each release increments the `minor` + * version. The `patch` and `pre` components are used in the typical manner. + * The `build` component is not generally used. + * @implements ISemanticVersion + * @constructor + * @param {proto.ISemanticVersion=} [p] Properties to set + */ + function SemanticVersion(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A major version.
+ * Hedera does not increment this value and retains a `0` value to + * indicate that API may change for any release. + *

+ * This value SHALL increment for an incompatible API change.
+ * @member {number} major + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.major = 0; + + /** + * A minor version.
+ * Hedera increments this value with each release.
+ * There may be incompatible API changes in any Hedera Services release. + *

+ * This value SHALL increment for backwards-compatible new + * functionality. + * @member {number} minor + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.minor = 0; + + /** + * A patch version. + *

+ * This value SHALL increment for backwards-compatible bug fixes. + * @member {number} patch + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.patch = 0; + + /** + * A pre-release version. + *

+ * This MAY be denoted by appending a hyphen and a series of dot separated + * identifiers per [Semver Specification](https://semver.org/#spec-item-9); + * given a string `0.14.0-alpha.1+21AF26D3`, this field would contain + * 'alpha.1' + * @member {string} pre + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.pre = ""; + + /** + * A build version. + *

+ * Build version MAY be denoted by appending a plus sign and a series of + * dot separated identifiers immediately following the patch or pre-release + * version per [Semver Specification](https://semver.org/#spec-item-10); so + * given a string `0.14.0-alpha.1+21AF26D3`, this field + * would contain '21AF26D3' + * @member {string} build + * @memberof proto.SemanticVersion + * @instance + */ + SemanticVersion.prototype.build = ""; + + /** + * Creates a new SemanticVersion instance using the specified properties. + * @function create + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion=} [properties] Properties to set + * @returns {proto.SemanticVersion} SemanticVersion instance + */ + SemanticVersion.create = function create(properties) { + return new SemanticVersion(properties); + }; + + /** + * Encodes the specified SemanticVersion message. Does not implicitly {@link proto.SemanticVersion.verify|verify} messages. + * @function encode + * @memberof proto.SemanticVersion + * @static + * @param {proto.ISemanticVersion} m SemanticVersion message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticVersion.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.major != null && Object.hasOwnProperty.call(m, "major")) + w.uint32(8).int32(m.major); + if (m.minor != null && Object.hasOwnProperty.call(m, "minor")) + w.uint32(16).int32(m.minor); + if (m.patch != null && Object.hasOwnProperty.call(m, "patch")) + w.uint32(24).int32(m.patch); + if (m.pre != null && Object.hasOwnProperty.call(m, "pre")) + w.uint32(34).string(m.pre); + if (m.build != null && Object.hasOwnProperty.call(m, "build")) + w.uint32(42).string(m.build); + return w; + }; + + /** + * Decodes a SemanticVersion message from the specified reader or buffer. + * @function decode + * @memberof proto.SemanticVersion + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.SemanticVersion} SemanticVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticVersion.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.SemanticVersion(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.major = r.int32(); + break; + } + case 2: { + m.minor = r.int32(); + break; + } + case 3: { + m.patch = r.int32(); + break; + } + case 4: { + m.pre = r.string(); + break; + } + case 5: { + m.build = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for SemanticVersion + * @function getTypeUrl + * @memberof proto.SemanticVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.SemanticVersion"; + }; + + return SemanticVersion; + })(); + + proto.Setting = (function() { + + /** + * Properties of a Setting. + * @memberof proto + * @interface ISetting + * @property {string|null} [name] A name for this setting property. + * @property {string|null} [value] A value for this setting property. + * @property {Uint8Array|null} [data] A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + */ + + /** + * Constructs a new Setting. + * @memberof proto + * @classdesc A single runtime configuration setting. + * + * Typically a name-value pair, this may also contain a small amount of + * associated data. + * @implements ISetting + * @constructor + * @param {proto.ISetting=} [p] Properties to set + */ + function Setting(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A name for this setting property. + * @member {string} name + * @memberof proto.Setting + * @instance + */ + Setting.prototype.name = ""; + + /** + * A value for this setting property. + * @member {string} value + * @memberof proto.Setting + * @instance + */ + Setting.prototype.value = ""; + + /** + * A small quantity of data associated with this setting. + *

+ * This SHOULD be less than 100 bytes.
+ * If the value is a string, it MUST be encoded UTF-8. + * @member {Uint8Array} data + * @memberof proto.Setting + * @instance + */ + Setting.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Setting instance using the specified properties. + * @function create + * @memberof proto.Setting + * @static + * @param {proto.ISetting=} [properties] Properties to set + * @returns {proto.Setting} Setting instance + */ + Setting.create = function create(properties) { + return new Setting(properties); + }; + + /** + * Encodes the specified Setting message. Does not implicitly {@link proto.Setting.verify|verify} messages. + * @function encode + * @memberof proto.Setting + * @static + * @param {proto.ISetting} m Setting message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Setting.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.name != null && Object.hasOwnProperty.call(m, "name")) + w.uint32(10).string(m.name); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(18).string(m.value); + if (m.data != null && Object.hasOwnProperty.call(m, "data")) + w.uint32(26).bytes(m.data); + return w; + }; + + /** + * Decodes a Setting message from the specified reader or buffer. + * @function decode + * @memberof proto.Setting + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Setting} Setting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Setting.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Setting(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.name = r.string(); + break; + } + case 2: { + m.value = r.string(); + break; + } + case 3: { + m.data = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Setting + * @function getTypeUrl + * @memberof proto.Setting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Setting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Setting"; + }; + + return Setting; + })(); + + proto.ServicesConfigurationList = (function() { + + /** + * Properties of a ServicesConfigurationList. + * @memberof proto + * @interface IServicesConfigurationList + * @property {Array.|null} [nameValue] A List of `Setting` values, typically read from application properties. + */ + + /** + * Constructs a new ServicesConfigurationList. + * @memberof proto + * @classdesc Setting values representing a source of runtime configuration information. + * @implements IServicesConfigurationList + * @constructor + * @param {proto.IServicesConfigurationList=} [p] Properties to set + */ + function ServicesConfigurationList(p) { + this.nameValue = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A List of `Setting` values, typically read from application properties. + * @member {Array.} nameValue + * @memberof proto.ServicesConfigurationList + * @instance + */ + ServicesConfigurationList.prototype.nameValue = $util.emptyArray; + + /** + * Creates a new ServicesConfigurationList instance using the specified properties. + * @function create + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList=} [properties] Properties to set + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList instance + */ + ServicesConfigurationList.create = function create(properties) { + return new ServicesConfigurationList(properties); + }; + + /** + * Encodes the specified ServicesConfigurationList message. Does not implicitly {@link proto.ServicesConfigurationList.verify|verify} messages. + * @function encode + * @memberof proto.ServicesConfigurationList + * @static + * @param {proto.IServicesConfigurationList} m ServicesConfigurationList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicesConfigurationList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.nameValue != null && m.nameValue.length) { + for (var i = 0; i < m.nameValue.length; ++i) + $root.proto.Setting.encode(m.nameValue[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a ServicesConfigurationList message from the specified reader or buffer. + * @function decode + * @memberof proto.ServicesConfigurationList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.ServicesConfigurationList} ServicesConfigurationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicesConfigurationList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.ServicesConfigurationList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.nameValue && m.nameValue.length)) + m.nameValue = []; + m.nameValue.push($root.proto.Setting.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for ServicesConfigurationList + * @function getTypeUrl + * @memberof proto.ServicesConfigurationList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicesConfigurationList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.ServicesConfigurationList"; + }; + + return ServicesConfigurationList; + })(); + + proto.TokenRelationship = (function() { + + /** + * Properties of a TokenRelationship. + * @memberof proto + * @interface ITokenRelationship + * @property {proto.ITokenID|null} [tokenId] A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @property {string|null} [symbol] A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @property {Long|null} [balance] An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @property {proto.TokenKycStatus|null} [kycStatus] A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @property {proto.TokenFreezeStatus|null} [freezeStatus] A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @property {number|null} [decimals] A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @property {boolean|null} [automaticAssociation] An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + */ + + /** + * Constructs a new TokenRelationship. + * @memberof proto + * @classdesc An Hedera Token Service token relationship. A token relationship describes + * the connection between an Account and a Token type, including the current + * account balance in that token. + * + * A `TokenRelationship` SHALL contain, for the designated token and enclosing + * account, The account's current balance, whether the account has KYC granted, + * whether the assets are frozen and whether the association was automatic.
+ * A `TokenRelationship` MAY also contain the `symbol` and `decimals` values + * copied from the token.
+ * `TokenRelationship` entries SHALL be valid only within the context of a + * `GetAccountDetails` query response, or other enclosing message, which + * specifies the account side of the relationship. + * @implements ITokenRelationship + * @constructor + * @param {proto.ITokenRelationship=} [p] Properties to set + */ + function TokenRelationship(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + *

+ * This MUST match an existing token that is not deleted. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.tokenId = null; + + /** + * A token symbol. + *

+ * This MUST match an existing token that is not deleted.
+ * This MUST match the value for the token identified in `tokenId`. + * @member {string} symbol + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.symbol = ""; + + /** + * An account balance for this token. + *

+ * For fungible/common tokens this SHALL be the balance that the + * account holds of that token. The value is provided as an integer amount + * of the smallest unit of the token (i.e. 10`-decimals` whole + * tokens).
+ * For non-fungible/unique tokens this SHALL be the whole number of + * unique tokens held by the account for this token type. + * @member {Long} balance + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A KYC status for the account with respect to this token. + *

+ * This may be `KycNotApplicable`, `Granted` or `Revoked` and, if KYC is + * not supported for this token (e.g. the `kyc_key` of the token is not + * set), this SHALL be `KycNotApplicable`. + * @member {proto.TokenKycStatus} kycStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.kycStatus = 0; + + /** + * A Freeze status for the account with respect to this token. + *

+ * This value SHALL be one of `FreezeNotApplicable`, `Frozen` + * or `Unfrozen`.
+ * If the token cannot freeze account assets (e.g. the `freeze_key` of the + * token is not set), this SHALL be `FreezeNotApplicable`. + * @member {proto.TokenFreezeStatus} freezeStatus + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.freezeStatus = 0; + + /** + * A maximum "precision" for this token. + *

+ * This value MUST match the `decimals` field of the token identified in + * the `tokenId` field.
+ * A single whole token SHALL be divided into at most + * 10`decimals` sub-units. + * @member {number} decimals + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.decimals = 0; + + /** + * An automatic association flag. + *

+ * This SHALL be set if the relationship was created implicitly + * (automatically).
+ * This SHALL be unset if the relationship was created explicitly + * (manually) via a `TokenAssociate` transaction. + * @member {boolean} automaticAssociation + * @memberof proto.TokenRelationship + * @instance + */ + TokenRelationship.prototype.automaticAssociation = false; + + /** + * Creates a new TokenRelationship instance using the specified properties. + * @function create + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship=} [properties] Properties to set + * @returns {proto.TokenRelationship} TokenRelationship instance + */ + TokenRelationship.create = function create(properties) { + return new TokenRelationship(properties); + }; + + /** + * Encodes the specified TokenRelationship message. Does not implicitly {@link proto.TokenRelationship.verify|verify} messages. + * @function encode + * @memberof proto.TokenRelationship + * @static + * @param {proto.ITokenRelationship} m TokenRelationship message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenRelationship.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.symbol != null && Object.hasOwnProperty.call(m, "symbol")) + w.uint32(18).string(m.symbol); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(24).uint64(m.balance); + if (m.kycStatus != null && Object.hasOwnProperty.call(m, "kycStatus")) + w.uint32(32).int32(m.kycStatus); + if (m.freezeStatus != null && Object.hasOwnProperty.call(m, "freezeStatus")) + w.uint32(40).int32(m.freezeStatus); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(48).uint32(m.decimals); + if (m.automaticAssociation != null && Object.hasOwnProperty.call(m, "automaticAssociation")) + w.uint32(56).bool(m.automaticAssociation); + return w; + }; + + /** + * Decodes a TokenRelationship message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenRelationship + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenRelationship} TokenRelationship + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenRelationship.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenRelationship(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.symbol = r.string(); + break; + } + case 3: { + m.balance = r.uint64(); + break; + } + case 4: { + m.kycStatus = r.int32(); + break; + } + case 5: { + m.freezeStatus = r.int32(); + break; + } + case 6: { + m.decimals = r.uint32(); + break; + } + case 7: { + m.automaticAssociation = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenRelationship + * @function getTypeUrl + * @memberof proto.TokenRelationship + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenRelationship.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenRelationship"; + }; + + return TokenRelationship; + })(); + + proto.TokenBalance = (function() { + + /** + * Properties of a TokenBalance. + * @memberof proto + * @interface ITokenBalance + * @property {proto.ITokenID|null} [tokenId] A token identifier. + * @property {Long|null} [balance] A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @property {number|null} [decimals] A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + */ + + /** + * Constructs a new TokenBalance. + * @memberof proto + * @classdesc A number of _transferable units_ of a specified token. + * + * The transferable unit of a token is its smallest denomination, as given by + * the token's `decimals` property. Each minted token contains + * 10`decimals` 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. + * @implements ITokenBalance + * @constructor + * @param {proto.ITokenBalance=} [p] Properties to set + */ + function TokenBalance(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.tokenId = null; + + /** + * A number of transferable units of the identified token. + *

+ * For fungible/common tokens this SHALL be the balance, in units of + * 10`-decimals` whole tokens.
+ * For non-fungible/unique tokens, this SHALL be the number of + * individual unique tokens in this balance. + * @member {Long} balance + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * A number of "decimals" precision. + *

+ * This MUST match the `decimals` value for the token identified by the + * `tokenId` field. + * @member {number} decimals + * @memberof proto.TokenBalance + * @instance + */ + TokenBalance.prototype.decimals = 0; + + /** + * Creates a new TokenBalance instance using the specified properties. + * @function create + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance=} [properties] Properties to set + * @returns {proto.TokenBalance} TokenBalance instance + */ + TokenBalance.create = function create(properties) { + return new TokenBalance(properties); + }; + + /** + * Encodes the specified TokenBalance message. Does not implicitly {@link proto.TokenBalance.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalance + * @static + * @param {proto.ITokenBalance} m TokenBalance message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalance.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.balance != null && Object.hasOwnProperty.call(m, "balance")) + w.uint32(16).uint64(m.balance); + if (m.decimals != null && Object.hasOwnProperty.call(m, "decimals")) + w.uint32(24).uint32(m.decimals); + return w; + }; + + /** + * Decodes a TokenBalance message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalance + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalance} TokenBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalance.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalance(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.balance = r.uint64(); + break; + } + case 3: { + m.decimals = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalance + * @function getTypeUrl + * @memberof proto.TokenBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalance"; + }; + + return TokenBalance; + })(); + + proto.TokenBalances = (function() { + + /** + * Properties of a TokenBalances. + * @memberof proto + * @interface ITokenBalances + * @property {Array.|null} [tokenBalances] A list of token balance values.
+ * Each entry represents a single account balance for a single token. + */ + + /** + * Constructs a new TokenBalances. + * @memberof proto + * @classdesc A set of token balance values. + * + * Each entry describes the balance the enclosing account holds for a specific + * token. The balance is an amount for a fungible/common token or a count for + * a non-fungible/unique token. + * @implements ITokenBalances + * @constructor + * @param {proto.ITokenBalances=} [p] Properties to set + */ + function TokenBalances(p) { + this.tokenBalances = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A list of token balance values.
+ * Each entry represents a single account balance for a single token. + * @member {Array.} tokenBalances + * @memberof proto.TokenBalances + * @instance + */ + TokenBalances.prototype.tokenBalances = $util.emptyArray; + + /** + * Creates a new TokenBalances instance using the specified properties. + * @function create + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances=} [properties] Properties to set + * @returns {proto.TokenBalances} TokenBalances instance + */ + TokenBalances.create = function create(properties) { + return new TokenBalances(properties); + }; + + /** + * Encodes the specified TokenBalances message. Does not implicitly {@link proto.TokenBalances.verify|verify} messages. + * @function encode + * @memberof proto.TokenBalances + * @static + * @param {proto.ITokenBalances} m TokenBalances message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenBalances.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenBalances != null && m.tokenBalances.length) { + for (var i = 0; i < m.tokenBalances.length; ++i) + $root.proto.TokenBalance.encode(m.tokenBalances[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a TokenBalances message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenBalances + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenBalances} TokenBalances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenBalances.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenBalances(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.tokenBalances && m.tokenBalances.length)) + m.tokenBalances = []; + m.tokenBalances.push($root.proto.TokenBalance.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenBalances + * @function getTypeUrl + * @memberof proto.TokenBalances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenBalances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenBalances"; + }; + + return TokenBalances; + })(); + + proto.TokenAssociation = (function() { + + /** + * Properties of a TokenAssociation. + * @memberof proto + * @interface ITokenAssociation + * @property {proto.ITokenID|null} [tokenId] A token identifier for the associated token. + * @property {proto.IAccountID|null} [accountId] An account identifier for the associated account. + */ + + /** + * Constructs a new TokenAssociation. + * @memberof proto + * @classdesc An association between a token and an account. + * + * An account must be associated with a token before that account can transact + * in (send or receive) that token. + * @implements ITokenAssociation + * @constructor + * @param {proto.ITokenAssociation=} [p] Properties to set + */ + function TokenAssociation(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A token identifier for the associated token. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.tokenId = null; + + /** + * An account identifier for the associated account. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.TokenAssociation + * @instance + */ + TokenAssociation.prototype.accountId = null; + + /** + * Creates a new TokenAssociation instance using the specified properties. + * @function create + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation=} [properties] Properties to set + * @returns {proto.TokenAssociation} TokenAssociation instance + */ + TokenAssociation.create = function create(properties) { + return new TokenAssociation(properties); + }; + + /** + * Encodes the specified TokenAssociation message. Does not implicitly {@link proto.TokenAssociation.verify|verify} messages. + * @function encode + * @memberof proto.TokenAssociation + * @static + * @param {proto.ITokenAssociation} m TokenAssociation message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TokenAssociation.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(10).fork()).ldelim(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a TokenAssociation message from the specified reader or buffer. + * @function decode + * @memberof proto.TokenAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TokenAssociation} TokenAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TokenAssociation.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TokenAssociation(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 2: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TokenAssociation + * @function getTypeUrl + * @memberof proto.TokenAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TokenAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TokenAssociation"; + }; + + return TokenAssociation; + })(); + + proto.StakingInfo = (function() { + + /** + * Properties of a StakingInfo. + * @memberof proto + * @interface IStakingInfo + * @property {boolean|null} [declineReward] A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @property {proto.ITimestamp|null} [stakePeriodStart] A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @property {Long|null} [pendingReward] An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @property {Long|null} [stakedToMe] A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @property {proto.IAccountID|null} [stakedAccountId] A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @property {Long|null} [stakedNodeId] A direct stake. + *

+ * This accounts stakes its balance to the designated node. + */ + + /** + * Constructs a new StakingInfo. + * @memberof proto + * @classdesc Staking information for an account or a contract. + * + * This is used for responses returned from `CryptoGetInfo` or + * `ContractGetInfo` queries. + * @implements IStakingInfo + * @constructor + * @param {proto.IStakingInfo=} [p] Properties to set + */ + function StakingInfo(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A flag indicating that the holder of this account has chosen to decline + * staking rewards. + * @member {boolean} declineReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.declineReward = false; + + /** + * A `Timestamp` of the start time for the latest active staking period. + *

+ * This MUST be a period during which either the staking settings for this + * account or contract changed or the account or contract received staking + * rewards, whichever is later. Examples of a change in staking settings + * include starting staking or changing the staked_node_id.
+ * If this account or contract is not currently staked to a node, then this + * field SHALL NOT be set. + * @member {proto.ITimestamp|null|undefined} stakePeriodStart + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakePeriodStart = null; + + /** + * An amount, in tinybar, to be received in the next reward payout.
+ * Rewards are not paid out immediately; for efficiency reasons rewards are + * only paid out as part of another transaction involving that account. + * @member {Long} pendingReward + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.pendingReward = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A proxy-staked balance.
+ * The total HBAR balance of all accounts that delegate staking to this + * account or contract. + * @member {Long} stakedToMe + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedToMe = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A delegated stake. + *

+ * This account delegates to the indicated account for staking purposes. + * @member {proto.IAccountID|null|undefined} stakedAccountId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedAccountId = null; + + /** + * A direct stake. + *

+ * This accounts stakes its balance to the designated node. + * @member {Long|null|undefined} stakedNodeId + * @memberof proto.StakingInfo + * @instance + */ + StakingInfo.prototype.stakedNodeId = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * StakingInfo stakedId. + * @member {"stakedAccountId"|"stakedNodeId"|undefined} stakedId + * @memberof proto.StakingInfo + * @instance + */ + Object.defineProperty(StakingInfo.prototype, "stakedId", { + get: $util.oneOfGetter($oneOfFields = ["stakedAccountId", "stakedNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StakingInfo instance using the specified properties. + * @function create + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo=} [properties] Properties to set + * @returns {proto.StakingInfo} StakingInfo instance + */ + StakingInfo.create = function create(properties) { + return new StakingInfo(properties); + }; + + /** + * Encodes the specified StakingInfo message. Does not implicitly {@link proto.StakingInfo.verify|verify} messages. + * @function encode + * @memberof proto.StakingInfo + * @static + * @param {proto.IStakingInfo} m StakingInfo message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StakingInfo.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.declineReward != null && Object.hasOwnProperty.call(m, "declineReward")) + w.uint32(8).bool(m.declineReward); + if (m.stakePeriodStart != null && Object.hasOwnProperty.call(m, "stakePeriodStart")) + $root.proto.Timestamp.encode(m.stakePeriodStart, w.uint32(18).fork()).ldelim(); + if (m.pendingReward != null && Object.hasOwnProperty.call(m, "pendingReward")) + w.uint32(24).int64(m.pendingReward); + if (m.stakedToMe != null && Object.hasOwnProperty.call(m, "stakedToMe")) + w.uint32(32).int64(m.stakedToMe); + if (m.stakedAccountId != null && Object.hasOwnProperty.call(m, "stakedAccountId")) + $root.proto.AccountID.encode(m.stakedAccountId, w.uint32(42).fork()).ldelim(); + if (m.stakedNodeId != null && Object.hasOwnProperty.call(m, "stakedNodeId")) + w.uint32(48).int64(m.stakedNodeId); + return w; + }; + + /** + * Decodes a StakingInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.StakingInfo + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.StakingInfo} StakingInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StakingInfo.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.StakingInfo(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.declineReward = r.bool(); + break; + } + case 2: { + m.stakePeriodStart = $root.proto.Timestamp.decode(r, r.uint32()); + break; + } + case 3: { + m.pendingReward = r.int64(); + break; + } + case 4: { + m.stakedToMe = r.int64(); + break; + } + case 5: { + m.stakedAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 6: { + m.stakedNodeId = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StakingInfo + * @function getTypeUrl + * @memberof proto.StakingInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StakingInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.StakingInfo"; + }; + + return StakingInfo; + })(); + + proto.PendingAirdropId = (function() { + + /** + * Properties of a PendingAirdropId. + * @memberof proto + * @interface IPendingAirdropId + * @property {proto.IAccountID|null} [senderId] A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @property {proto.IAccountID|null} [receiverId] A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @property {proto.ITokenID|null} [fungibleTokenType] A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @property {proto.INftID|null} [nonFungibleToken] The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + */ + + /** + * Constructs a new PendingAirdropId. + * @memberof proto + * @classdesc A unique, composite, identifier for a pending airdrop. + * + * Each pending airdrop SHALL be uniquely identified by + * a `PendingAirdropId`.
+ * A `PendingAirdropId` SHALL be recorded when created and MUST be provided in + * any transaction that would modify that pending airdrop + * (such as a `claimAirdrop` or `cancelAirdrop`). + * @implements IPendingAirdropId + * @constructor + * @param {proto.IPendingAirdropId=} [p] Properties to set + */ + function PendingAirdropId(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A sending account. + *

+ * This is the account that initiated, and SHALL fund, + * this pending airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} senderId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.senderId = null; + + /** + * A receiving account. + *

+ * This is the ID of the account that SHALL receive the airdrop.
+ * This field is REQUIRED. + * @member {proto.IAccountID|null|undefined} receiverId + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.receiverId = null; + + /** + * A token identifier.
+ * This is the type of token for a fungible/common token airdrop. + *

+ * This field is REQUIRED for a fungible/common token and MUST NOT + * be used for a non-fungible/unique token. + * @member {proto.ITokenID|null|undefined} fungibleTokenType + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.fungibleTokenType = null; + + /** + * The id of a single NFT
+ * This is the type of token for a non-fungible/unique token airdrop + * and consists of a Token ID and serial number. + *

+ * This field is REQUIRED for a non-fungible/unique token and + * MUST NOT be used for a fungible/common token. + * @member {proto.INftID|null|undefined} nonFungibleToken + * @memberof proto.PendingAirdropId + * @instance + */ + PendingAirdropId.prototype.nonFungibleToken = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingAirdropId tokenReference. + * @member {"fungibleTokenType"|"nonFungibleToken"|undefined} tokenReference + * @memberof proto.PendingAirdropId + * @instance + */ + Object.defineProperty(PendingAirdropId.prototype, "tokenReference", { + get: $util.oneOfGetter($oneOfFields = ["fungibleTokenType", "nonFungibleToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingAirdropId instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId=} [properties] Properties to set + * @returns {proto.PendingAirdropId} PendingAirdropId instance + */ + PendingAirdropId.create = function create(properties) { + return new PendingAirdropId(properties); + }; + + /** + * Encodes the specified PendingAirdropId message. Does not implicitly {@link proto.PendingAirdropId.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropId + * @static + * @param {proto.IPendingAirdropId} m PendingAirdropId message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropId.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.senderId != null && Object.hasOwnProperty.call(m, "senderId")) + $root.proto.AccountID.encode(m.senderId, w.uint32(10).fork()).ldelim(); + if (m.receiverId != null && Object.hasOwnProperty.call(m, "receiverId")) + $root.proto.AccountID.encode(m.receiverId, w.uint32(18).fork()).ldelim(); + if (m.fungibleTokenType != null && Object.hasOwnProperty.call(m, "fungibleTokenType")) + $root.proto.TokenID.encode(m.fungibleTokenType, w.uint32(26).fork()).ldelim(); + if (m.nonFungibleToken != null && Object.hasOwnProperty.call(m, "nonFungibleToken")) + $root.proto.NftID.encode(m.nonFungibleToken, w.uint32(34).fork()).ldelim(); + return w; + }; + + /** + * Decodes a PendingAirdropId message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropId + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropId} PendingAirdropId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropId.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropId(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.senderId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + m.receiverId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 3: { + m.fungibleTokenType = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 4: { + m.nonFungibleToken = $root.proto.NftID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropId + * @function getTypeUrl + * @memberof proto.PendingAirdropId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropId"; + }; + + return PendingAirdropId; + })(); + + proto.PendingAirdropValue = (function() { + + /** + * Properties of a PendingAirdropValue. + * @memberof proto + * @interface IPendingAirdropValue + * @property {Long|null} [amount] An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + */ + + /** + * Constructs a new PendingAirdropValue. + * @memberof proto + * @classdesc A single pending airdrop value. + * + * This message SHALL record the airdrop amount for a + * fungible/common token.
+ * This message SHOULD be null for a non-fungible/unique token.
+ * If a non-null `PendingAirdropValue` is set for a non-fungible/unique + * token, the amount field MUST be `0`. + * + * It is RECOMMENDED that implementations store pending airdrop information + * as a key-value map from `PendingAirdropId` to `PendingAirdropValue`, with + * a `null` value used for non-fungible pending airdrops. + * @implements IPendingAirdropValue + * @constructor + * @param {proto.IPendingAirdropValue=} [p] Properties to set + */ + function PendingAirdropValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount to transfer for fungible/common tokens.
+ * This is expressed in the smallest available units for that token + * (i.e. 10-`decimals` whole tokens). + *

+ * This amount SHALL be transferred from the sender to the receiver, + * if claimed.
+ * If the token is a fungible/common token, this value MUST be strictly + * greater than `0`.
+ * If the token is a non-fungible/unique token, this message SHOULD NOT + * be set, and if set, this field MUST be `0`. + * @member {Long} amount + * @memberof proto.PendingAirdropValue + * @instance + */ + PendingAirdropValue.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new PendingAirdropValue instance using the specified properties. + * @function create + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue=} [properties] Properties to set + * @returns {proto.PendingAirdropValue} PendingAirdropValue instance + */ + PendingAirdropValue.create = function create(properties) { + return new PendingAirdropValue(properties); + }; + + /** + * Encodes the specified PendingAirdropValue message. Does not implicitly {@link proto.PendingAirdropValue.verify|verify} messages. + * @function encode + * @memberof proto.PendingAirdropValue + * @static + * @param {proto.IPendingAirdropValue} m PendingAirdropValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingAirdropValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).uint64(m.amount); + return w; + }; + + /** + * Decodes a PendingAirdropValue message from the specified reader or buffer. + * @function decode + * @memberof proto.PendingAirdropValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.PendingAirdropValue} PendingAirdropValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingAirdropValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.PendingAirdropValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for PendingAirdropValue + * @function getTypeUrl + * @memberof proto.PendingAirdropValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingAirdropValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.PendingAirdropValue"; + }; + + return PendingAirdropValue; + })(); + + proto.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof proto + * @interface IDuration + * @property {Long|null} [seconds] The number of seconds for this duration. + */ + + /** + * Constructs a new Duration. + * @memberof proto + * @classdesc A length of time in seconds. + * + * It is RECOMMENDED that this message be used whenever an amount of time, + * rather than a specific point in time, is needed. + * @implements IDuration + * @constructor + * @param {proto.IDuration=} [p] Properties to set + */ + function Duration(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of seconds for this duration. + * @member {Long} seconds + * @memberof proto.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof proto.Duration + * @static + * @param {proto.IDuration=} [properties] Properties to set + * @returns {proto.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link proto.Duration.verify|verify} messages. + * @function encode + * @memberof proto.Duration + * @static + * @param {proto.IDuration} m Duration message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof proto.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Duration(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof proto.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Duration"; + }; + + return Duration; + })(); + + proto.FractionalFee = (function() { + + /** + * Properties of a FractionalFee. + * @memberof proto + * @interface IFractionalFee + * @property {proto.IFraction|null} [fractionalAmount] A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @property {Long|null} [minimumAmount] A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @property {Long|null} [maximumAmount] A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @property {boolean|null} [netOfTransfers] Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ */ + + /** + * Constructs a new FractionalFee. + * @memberof proto + * @classdesc A descriptor for a fee based on a portion of the tokens transferred. + * + * This fee option describes fees as a fraction of the amount of + * fungible/common token(s) transferred. The fee also describes a minimum + * and maximum amount, both of which are OPTIONAL. + * + * This type of fee SHALL be assessed only for fungible/common tokens.
+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee SHALL be paid with the same type of tokens as those + * transferred.
+ * The fee MAY be subtracted from the transferred tokens, or MAY be assessed + * to the sender in addition to the tokens actually transferred, based on + * the `net_of_transfers` field. + * + * When a single transaction sends tokens from one sender to multiple + * recipients, and the `net_of_transfers` flag is false, the network + * SHALL attempt to evenly assess the total fee across all recipients + * proportionally. This may be inexact and, particularly when there are + * large differences between recipients, MAY result in small deviations + * from an ideal "fair" distribution.
+ * If the sender lacks sufficient tokens to pay fees, or the assessment + * of custom fees reduces the net amount transferred to or below zero, + * the transaction MAY fail due to insufficient funds to pay all fees. + * @implements IFractionalFee + * @constructor + * @param {proto.IFractionalFee=} [p] Properties to set + */ + function FractionalFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A Fraction of the transferred tokens to assess as a fee.
+ * This value MUST be less than or equal to one.
+ * This value MUST be greater than zero. + * @member {proto.IFraction|null|undefined} fractionalAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.fractionalAmount = null; + + /** + * A minimum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no minimum.
+ * If set, this value MUST be greater than zero.
+ * If set, all transfers SHALL pay at least this amount. + * @member {Long} minimumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.minimumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * A maximum fee to charge, in units of 10-decimals tokens. + *

+ * This value is OPTIONAL, with a default of `0` indicating no maximum.
+ * If set, this value MUST be greater than zero.
+ * If set, any fee charged SHALL NOT exceed this value.
+ * This value SHOULD be strictly greater than `minimum_amount`. + * If this amount is less than or equal to `minimum_amount`, then + * the fee charged SHALL always be equal to this value and + * `fractional_amount` SHALL NOT have any effect. + * @member {Long} maximumAmount + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.maximumAmount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Flag requesting to assess the calculated fee against the sender, + * without reducing the amount transferred.
+ * #### Effects of this flag + *

    + *
  1. If this value is true + *
      + *
    • The receiver of a transfer SHALL receive the entire + * amount sent.
    • + *
    • The fee SHALL be charged to the sender as an additional + * amount, increasing the token transfer debit.
    • + *
    + *
  2. + *
  3. If this value is false + *
      + *
    • The receiver of a transfer SHALL receive the amount sent + * _after_ deduction of the calculated fee.
    • + *
    + *
  4. + *
+ * @member {boolean} netOfTransfers + * @memberof proto.FractionalFee + * @instance + */ + FractionalFee.prototype.netOfTransfers = false; + + /** + * Creates a new FractionalFee instance using the specified properties. + * @function create + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee=} [properties] Properties to set + * @returns {proto.FractionalFee} FractionalFee instance + */ + FractionalFee.create = function create(properties) { + return new FractionalFee(properties); + }; + + /** + * Encodes the specified FractionalFee message. Does not implicitly {@link proto.FractionalFee.verify|verify} messages. + * @function encode + * @memberof proto.FractionalFee + * @static + * @param {proto.IFractionalFee} m FractionalFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FractionalFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fractionalAmount != null && Object.hasOwnProperty.call(m, "fractionalAmount")) + $root.proto.Fraction.encode(m.fractionalAmount, w.uint32(10).fork()).ldelim(); + if (m.minimumAmount != null && Object.hasOwnProperty.call(m, "minimumAmount")) + w.uint32(16).int64(m.minimumAmount); + if (m.maximumAmount != null && Object.hasOwnProperty.call(m, "maximumAmount")) + w.uint32(24).int64(m.maximumAmount); + if (m.netOfTransfers != null && Object.hasOwnProperty.call(m, "netOfTransfers")) + w.uint32(32).bool(m.netOfTransfers); + return w; + }; + + /** + * Decodes a FractionalFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FractionalFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FractionalFee} FractionalFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FractionalFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FractionalFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fractionalAmount = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.minimumAmount = r.int64(); + break; + } + case 3: { + m.maximumAmount = r.int64(); + break; + } + case 4: { + m.netOfTransfers = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FractionalFee + * @function getTypeUrl + * @memberof proto.FractionalFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FractionalFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FractionalFee"; + }; + + return FractionalFee; + })(); + + proto.FixedFee = (function() { + + /** + * Properties of a FixedFee. + * @memberof proto + * @interface IFixedFee + * @property {Long|null} [amount] The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [denominatingTokenId] The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + */ + + /** + * Constructs a new FixedFee. + * @memberof proto + * @classdesc A fixed fee to assess for each token transfer, regardless of the + * amount transferred.
+ * This fee type describes a fixed fee for each transfer of a token type. + * + * The fee SHALL be charged to the `sender` for the token transfer + * transaction.
+ * This fee MAY be assessed in HBAR, the token type transferred, or any + * other token type, as determined by the `denominating_token_id` field. + * @implements IFixedFee + * @constructor + * @param {proto.IFixedFee=} [p] Properties to set + */ + function FixedFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The amount to assess for each transfer. + *

+ * This value MUST be greater than `0`.
+ * This amount is expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token type used to pay the assessed fee. + *

+ * If this is unset, the fee SHALL be assessed in HBAR.
+ * If this is set, the fee SHALL be assessed in the token identified. + * This MAY be any token type. Custom fees assessed in other token types + * are more likely to fail, however, and it is RECOMMENDED that token + * creators denominate custom fees in the transferred token, HBAR, or + * well documented and closely related token types.
+ * If this value is set to `0.0.0` in the `tokenCreate` transaction, it + * SHALL be replaced with the `TokenID` of the newly created token. + * @member {proto.ITokenID|null|undefined} denominatingTokenId + * @memberof proto.FixedFee + * @instance + */ + FixedFee.prototype.denominatingTokenId = null; + + /** + * Creates a new FixedFee instance using the specified properties. + * @function create + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee=} [properties] Properties to set + * @returns {proto.FixedFee} FixedFee instance + */ + FixedFee.create = function create(properties) { + return new FixedFee(properties); + }; + + /** + * Encodes the specified FixedFee message. Does not implicitly {@link proto.FixedFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedFee + * @static + * @param {proto.IFixedFee} m FixedFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.denominatingTokenId != null && Object.hasOwnProperty.call(m, "denominatingTokenId")) + $root.proto.TokenID.encode(m.denominatingTokenId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedFee} FixedFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.denominatingTokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedFee + * @function getTypeUrl + * @memberof proto.FixedFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedFee"; + }; + + return FixedFee; + })(); + + proto.RoyaltyFee = (function() { + + /** + * Properties of a RoyaltyFee. + * @memberof proto + * @interface IRoyaltyFee + * @property {proto.IFraction|null} [exchangeValueFraction] The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @property {proto.IFixedFee|null} [fallbackFee] A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + */ + + /** + * Constructs a new RoyaltyFee. + * @memberof proto + * @classdesc A fee to assess during a CryptoTransfer that changes ownership of a + * non-fungible/unique (NFT) token.
+ * This message defines the fraction of the fungible value exchanged for an + * NFT that the ledger should collect as a royalty. + * "Fungible value" includes both HBAR (ℏ) 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 non-fungible/unique tokens. + * + * #### Important Note + * > Users should be aware that native royalty fees are _strictly_ a + * > convenience feature, SHALL NOT be guaranteed, and the network SHALL NOT + * > enforce _inescapable_ royalties on the exchange of a unique NFT.
+ * > For _one_ example, if the counterparties agree to split their value + * > transfer and NFT exchange into separate transactions, the network cannot + * > possibly determine the value exchanged. Even trustless transactions, + * > using a smart contract or other form of escrow, can arrange such split + * > transactions as a single _logical_ transfer. + * + * Counterparties that wish to _respect_ creator royalties MUST follow the + * pattern the network recognizes. + *

+ * A single transaction MUST contain all three elements, transfer of the NFT, + * debit of fungible value from the receiver, and credit of fungible value to + * the sender, in order for the network to accurately assess royalty fees. + *
+ *
+ * Two examples are presented here. + *
+ * The NFT sender and receiver MUST both sign a single `cryptoTransfer` that + * transfers the NFT from sender to receiver, debits the fungible value from + * the receiver, and credits the sender with the fungible value the receiver + * is exchanging for the NFT.
+ * A marketplace using an approved spender account for an escrow transaction + * MUST credit the account selling the NFT in the same `cryptoTransfer` + * transaction that transfers the NFT to, and deducts fungible value from, + * the buying account. + *
+ * This type of fee MAY NOT produce accurate results if multiple transfers + * are executed in a single transaction. It is RECOMMENDED that each + * NFT subject to royalty fees be transferred separately and without + * unrelated fungible token transfers. + * + * The network SHALL NOT consider third-party transfers, including + * "approved spender" accounts, in collecting royalty fees. An honest + * broker MUST ensure that transfer of an NFT and payment delivered to + * the sender are present in the same transaction. + * There is an + * [open suggestion](https://github.com/hashgraph/hedera-improvement-proposal/discussions/578) + * that proposes to broaden the scope of transfers from which the network + * automatically collects royalties to cover related third parties. If this + * interests or concerns you, please add your voice to that discussion. + * @implements IRoyaltyFee + * @constructor + * @param {proto.IRoyaltyFee=} [p] Properties to set + */ + function RoyaltyFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The fraction of fungible value exchanged for an NFT to collect + * as royalty. + *

+ * This SHALL be applied once to the total fungible value transferred + * for the transaction.
+ * There SHALL NOT be any adjustment based on multiple transfers + * involving the NFT sender as part of a single transaction. + * @member {proto.IFraction|null|undefined} exchangeValueFraction + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.exchangeValueFraction = null; + + /** + * A fixed fee to assess if no fungible value is known to be traded + * for the NFT. + *

+ * If an NFT is transferred without a corresponding transfer of + * _fungible_ value returned in the same transaction, the network + * SHALL charge this fee as a fallback.
+ * Fallback fees MAY have unexpected effects when interacting with + * escrow, market transfers, and smart contracts. + * It is RECOMMENDED that developers carefully consider possible + * effects from fallback fees when designing systems that facilitate + * the transfer of NFTs. + * @member {proto.IFixedFee|null|undefined} fallbackFee + * @memberof proto.RoyaltyFee + * @instance + */ + RoyaltyFee.prototype.fallbackFee = null; + + /** + * Creates a new RoyaltyFee instance using the specified properties. + * @function create + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee=} [properties] Properties to set + * @returns {proto.RoyaltyFee} RoyaltyFee instance + */ + RoyaltyFee.create = function create(properties) { + return new RoyaltyFee(properties); + }; + + /** + * Encodes the specified RoyaltyFee message. Does not implicitly {@link proto.RoyaltyFee.verify|verify} messages. + * @function encode + * @memberof proto.RoyaltyFee + * @static + * @param {proto.IRoyaltyFee} m RoyaltyFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoyaltyFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.exchangeValueFraction != null && Object.hasOwnProperty.call(m, "exchangeValueFraction")) + $root.proto.Fraction.encode(m.exchangeValueFraction, w.uint32(10).fork()).ldelim(); + if (m.fallbackFee != null && Object.hasOwnProperty.call(m, "fallbackFee")) + $root.proto.FixedFee.encode(m.fallbackFee, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a RoyaltyFee message from the specified reader or buffer. + * @function decode + * @memberof proto.RoyaltyFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.RoyaltyFee} RoyaltyFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoyaltyFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.RoyaltyFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.exchangeValueFraction = $root.proto.Fraction.decode(r, r.uint32()); + break; + } + case 2: { + m.fallbackFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for RoyaltyFee + * @function getTypeUrl + * @memberof proto.RoyaltyFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoyaltyFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.RoyaltyFee"; + }; + + return RoyaltyFee; + })(); + + proto.CustomFee = (function() { + + /** + * Properties of a CustomFee. + * @memberof proto + * @interface ICustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @property {proto.IFractionalFee|null} [fractionalFee] A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @property {proto.IRoyaltyFee|null} [royaltyFee] A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @property {proto.IAccountID|null} [feeCollectorAccountId] The account to receive the custom fee. + * @property {boolean|null} [allCollectorsAreExempt] Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + */ + + /** + * Constructs a new CustomFee. + * @memberof proto + * @classdesc A transfer fee to assess during a CryptoTransfer.
+ * This fee applies to transactions that transfer 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. + * + * Custom fees MUST be greater than zero (0). + * @implements ICustomFee + * @constructor + * @param {proto.ICustomFee=} [p] Properties to set + */ + function CustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed fee to be charged to the `sender` for every token transfer. + *

+ * This type of fee MAY be defined for any token type.
+ * This type of fee MAY be more consistent and reliable than + * other types. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fixedFee = null; + + /** + * A fee defined as a fraction of the tokens transferred. + *

+ * This type of fee MUST NOT be defined for a non-fungible/unique + * token type.
+ * This fee MAY be charged to either sender, as an increase to the + * amount sent, or receiver, as a reduction to the amount received. + * @member {proto.IFractionalFee|null|undefined} fractionalFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.fractionalFee = null; + + /** + * A fee charged as royalty for any transfer of a + * non-fungible/unique token. + *

+ * This type of fee MUST NOT be defined for a + * fungible/common token type. + * @member {proto.IRoyaltyFee|null|undefined} royaltyFee + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.royaltyFee = null; + + /** + * The account to receive the custom fee. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.feeCollectorAccountId = null; + + /** + * Flag indicating to exempt all custom fee collector accounts for this + * token type from paying this custom fee when sending tokens. + *

+ * The treasury account for a token, and the account identified by the + * `fee_collector_account_id` field of this `CustomFee` are always exempt + * from this custom fee to avoid redundant and unnecessary transfers. + * If this value is `true` then the account(s) identified in + * `fee_collector_account_id` for _all_ custom fee definitions for this + * token type SHALL also be exempt from this custom fee. + * This behavior is specified in HIP-573. + * @member {boolean} allCollectorsAreExempt + * @memberof proto.CustomFee + * @instance + */ + CustomFee.prototype.allCollectorsAreExempt = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * CustomFee fee. + * @member {"fixedFee"|"fractionalFee"|"royaltyFee"|undefined} fee + * @memberof proto.CustomFee + * @instance + */ + Object.defineProperty(CustomFee.prototype, "fee", { + get: $util.oneOfGetter($oneOfFields = ["fixedFee", "fractionalFee", "royaltyFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomFee instance using the specified properties. + * @function create + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee=} [properties] Properties to set + * @returns {proto.CustomFee} CustomFee instance + */ + CustomFee.create = function create(properties) { + return new CustomFee(properties); + }; + + /** + * Encodes the specified CustomFee message. Does not implicitly {@link proto.CustomFee.verify|verify} messages. + * @function encode + * @memberof proto.CustomFee + * @static + * @param {proto.ICustomFee} m CustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.fractionalFee != null && Object.hasOwnProperty.call(m, "fractionalFee")) + $root.proto.FractionalFee.encode(m.fractionalFee, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.royaltyFee != null && Object.hasOwnProperty.call(m, "royaltyFee")) + $root.proto.RoyaltyFee.encode(m.royaltyFee, w.uint32(34).fork()).ldelim(); + if (m.allCollectorsAreExempt != null && Object.hasOwnProperty.call(m, "allCollectorsAreExempt")) + w.uint32(40).bool(m.allCollectorsAreExempt); + return w; + }; + + /** + * Decodes a CustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFee} CustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.fractionalFee = $root.proto.FractionalFee.decode(r, r.uint32()); + break; + } + case 4: { + m.royaltyFee = $root.proto.RoyaltyFee.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 5: { + m.allCollectorsAreExempt = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFee + * @function getTypeUrl + * @memberof proto.CustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFee"; + }; + + return CustomFee; + })(); + + proto.AssessedCustomFee = (function() { + + /** + * Properties of an AssessedCustomFee. + * @memberof proto + * @interface IAssessedCustomFee + * @property {Long|null} [amount] An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @property {proto.ITokenID|null} [tokenId] The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @property {proto.IAccountID|null} [feeCollectorAccountId] An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @property {Array.|null} [effectivePayerAccountId] An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + */ + + /** + * Constructs a new AssessedCustomFee. + * @memberof proto + * @classdesc Description of a transfer added to a `cryptoTransfer` transaction that + * satisfies custom fee requirements. + * + * It is important to note that this is not the actual transfer. The transfer + * of value SHALL be merged into the original transaction to minimize the + * number of actual transfers. This descriptor presents the fee assessed + * separately in the record stream so that the details of the fee assessed + * are not hidden in this process. + * @implements IAssessedCustomFee + * @constructor + * @param {proto.IAssessedCustomFee=} [p] Properties to set + */ + function AssessedCustomFee(p) { + this.effectivePayerAccountId = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * An amount of tokens assessed for this custom fee. + *

+ * This shall be expressed in units of 10-decimals tokens. + * @member {Long} amount + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The token transferred to satisfy this fee. + *

+ * If the token transferred is HBAR, this field SHALL NOT be set. + * @member {proto.ITokenID|null|undefined} tokenId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.tokenId = null; + + /** + * An account that received the fee assessed. + *

+ * This SHALL NOT be the sender or receiver of the original + * cryptoTransfer transaction. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * An account that provided the tokens assessed as a fee. + *

+ * This SHALL be the account that _would have_ had a higher balance + * absent the fee. In most cases this SHALL be the `sender`, but + * some _fractional_ fees reduce the amount transferred, and in those + * cases the `receiver` SHALL be the effective payer for the fee.
+ * There are currently no situations where a third party pays a custom + * fee. This MAY change in a future release. + * @member {Array.} effectivePayerAccountId + * @memberof proto.AssessedCustomFee + * @instance + */ + AssessedCustomFee.prototype.effectivePayerAccountId = $util.emptyArray; + + /** + * Creates a new AssessedCustomFee instance using the specified properties. + * @function create + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee=} [properties] Properties to set + * @returns {proto.AssessedCustomFee} AssessedCustomFee instance + */ + AssessedCustomFee.create = function create(properties) { + return new AssessedCustomFee(properties); + }; + + /** + * Encodes the specified AssessedCustomFee message. Does not implicitly {@link proto.AssessedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.AssessedCustomFee + * @static + * @param {proto.IAssessedCustomFee} m AssessedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssessedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.amount != null && Object.hasOwnProperty.call(m, "amount")) + w.uint32(8).int64(m.amount); + if (m.tokenId != null && Object.hasOwnProperty.call(m, "tokenId")) + $root.proto.TokenID.encode(m.tokenId, w.uint32(18).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(26).fork()).ldelim(); + if (m.effectivePayerAccountId != null && m.effectivePayerAccountId.length) { + for (var i = 0; i < m.effectivePayerAccountId.length; ++i) + $root.proto.AccountID.encode(m.effectivePayerAccountId[i], w.uint32(34).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes an AssessedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.AssessedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.AssessedCustomFee} AssessedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssessedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.AssessedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.amount = r.int64(); + break; + } + case 2: { + m.tokenId = $root.proto.TokenID.decode(r, r.uint32()); + break; + } + case 3: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 4: { + if (!(m.effectivePayerAccountId && m.effectivePayerAccountId.length)) + m.effectivePayerAccountId = []; + m.effectivePayerAccountId.push($root.proto.AccountID.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for AssessedCustomFee + * @function getTypeUrl + * @memberof proto.AssessedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssessedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.AssessedCustomFee"; + }; + + return AssessedCustomFee; + })(); + + proto.FixedCustomFee = (function() { + + /** + * Properties of a FixedCustomFee. + * @memberof proto + * @interface IFixedCustomFee + * @property {proto.IFixedFee|null} [fixedFee] A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @property {proto.IAccountID|null} [feeCollectorAccountId] A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + */ + + /** + * Constructs a new FixedCustomFee. + * @memberof proto + * @classdesc A custom fee definition for a consensus topic. + *

+ * This fee definition is specific to an Hedera Consensus Service (HCS) topic + * and SHOULD NOT be used in any other context.
+ * All fields for this message are REQUIRED.
+ * Only "fixed" fee definitions are supported because there is no basis for + * a fractional fee on a consensus submit transaction. + * @implements IFixedCustomFee + * @constructor + * @param {proto.IFixedCustomFee=} [p] Properties to set + */ + function FixedCustomFee(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A fixed custom fee. + *

+ * The amount of HBAR or other token described by this `FixedFee` SHALL + * be charged to the transction payer for each message submitted to a + * topic that assigns this consensus custom fee. + * @member {proto.IFixedFee|null|undefined} fixedFee + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.fixedFee = null; + + /** + * A collection account identifier. + *

+ * All amounts collected for this consensus custom fee SHALL be transferred + * to the account identified by this field. + * @member {proto.IAccountID|null|undefined} feeCollectorAccountId + * @memberof proto.FixedCustomFee + * @instance + */ + FixedCustomFee.prototype.feeCollectorAccountId = null; + + /** + * Creates a new FixedCustomFee instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee=} [properties] Properties to set + * @returns {proto.FixedCustomFee} FixedCustomFee instance + */ + FixedCustomFee.create = function create(properties) { + return new FixedCustomFee(properties); + }; + + /** + * Encodes the specified FixedCustomFee message. Does not implicitly {@link proto.FixedCustomFee.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFee + * @static + * @param {proto.IFixedCustomFee} m FixedCustomFee message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFee.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fixedFee != null && Object.hasOwnProperty.call(m, "fixedFee")) + $root.proto.FixedFee.encode(m.fixedFee, w.uint32(10).fork()).ldelim(); + if (m.feeCollectorAccountId != null && Object.hasOwnProperty.call(m, "feeCollectorAccountId")) + $root.proto.AccountID.encode(m.feeCollectorAccountId, w.uint32(18).fork()).ldelim(); + return w; + }; + + /** + * Decodes a FixedCustomFee message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFee + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFee} FixedCustomFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFee.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFee(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.fixedFee = $root.proto.FixedFee.decode(r, r.uint32()); + break; + } + case 2: { + m.feeCollectorAccountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFee + * @function getTypeUrl + * @memberof proto.FixedCustomFee + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFee"; + }; + + return FixedCustomFee; + })(); + + proto.FixedCustomFeeList = (function() { + + /** + * Properties of a FixedCustomFeeList. + * @memberof proto + * @interface IFixedCustomFeeList + * @property {Array.|null} [fees] A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + */ + + /** + * Constructs a new FixedCustomFeeList. + * @memberof proto + * @classdesc A wrapper around a consensus custom fee list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of custom fees. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `fees` list SHALL remove any + * existing values. + * @implements IFixedCustomFeeList + * @constructor + * @param {proto.IFixedCustomFeeList=} [p] Properties to set + */ + function FixedCustomFeeList(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of custom fee definitions.
+ * These are fees to be assessed for each submit to a topic. + * @member {Array.} fees + * @memberof proto.FixedCustomFeeList + * @instance + */ + FixedCustomFeeList.prototype.fees = $util.emptyArray; + + /** + * Creates a new FixedCustomFeeList instance using the specified properties. + * @function create + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList=} [properties] Properties to set + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList instance + */ + FixedCustomFeeList.create = function create(properties) { + return new FixedCustomFeeList(properties); + }; + + /** + * Encodes the specified FixedCustomFeeList message. Does not implicitly {@link proto.FixedCustomFeeList.verify|verify} messages. + * @function encode + * @memberof proto.FixedCustomFeeList + * @static + * @param {proto.IFixedCustomFeeList} m FixedCustomFeeList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedCustomFeeList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedCustomFee.encode(m.fees[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FixedCustomFeeList message from the specified reader or buffer. + * @function decode + * @memberof proto.FixedCustomFeeList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FixedCustomFeeList} FixedCustomFeeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedCustomFeeList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FixedCustomFeeList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedCustomFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FixedCustomFeeList + * @function getTypeUrl + * @memberof proto.FixedCustomFeeList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedCustomFeeList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FixedCustomFeeList"; + }; + + return FixedCustomFeeList; + })(); + + proto.FeeExemptKeyList = (function() { + + /** + * Properties of a FeeExemptKeyList. + * @memberof proto + * @interface IFeeExemptKeyList + * @property {Array.|null} [keys] A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + */ + + /** + * Constructs a new FeeExemptKeyList. + * @memberof proto + * @classdesc A wrapper for fee exempt key list.
+ * This wrapper exists to enable an update transaction to differentiate between + * a field that is not set and an empty list of keys. + *

+ * An _unset_ field of this type SHALL NOT modify existing values.
+ * A _set_ field of this type with an empty `keys` list SHALL remove any + * existing values. + * @implements IFeeExemptKeyList + * @constructor + * @param {proto.IFeeExemptKeyList=} [p] Properties to set + */ + function FeeExemptKeyList(p) { + this.keys = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A set of keys.
+ * The keys in this list are permitted to submit messages to the + * topic without paying the topic's custom fees. + *

+ * If a submit transaction is signed by _any_ key included in this set, + * custom fees SHALL NOT be charged for that transaction. + * @member {Array.} keys + * @memberof proto.FeeExemptKeyList + * @instance + */ + FeeExemptKeyList.prototype.keys = $util.emptyArray; + + /** + * Creates a new FeeExemptKeyList instance using the specified properties. + * @function create + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList=} [properties] Properties to set + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList instance + */ + FeeExemptKeyList.create = function create(properties) { + return new FeeExemptKeyList(properties); + }; + + /** + * Encodes the specified FeeExemptKeyList message. Does not implicitly {@link proto.FeeExemptKeyList.verify|verify} messages. + * @function encode + * @memberof proto.FeeExemptKeyList + * @static + * @param {proto.IFeeExemptKeyList} m FeeExemptKeyList message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeeExemptKeyList.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.keys != null && m.keys.length) { + for (var i = 0; i < m.keys.length; ++i) + $root.proto.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a FeeExemptKeyList message from the specified reader or buffer. + * @function decode + * @memberof proto.FeeExemptKeyList + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.FeeExemptKeyList} FeeExemptKeyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeeExemptKeyList.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.FeeExemptKeyList(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + if (!(m.keys && m.keys.length)) + m.keys = []; + m.keys.push($root.proto.Key.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FeeExemptKeyList + * @function getTypeUrl + * @memberof proto.FeeExemptKeyList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeeExemptKeyList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.FeeExemptKeyList"; + }; + + return FeeExemptKeyList; + })(); + + proto.CustomFeeLimit = (function() { + + /** + * Properties of a CustomFeeLimit. + * @memberof proto + * @interface ICustomFeeLimit + * @property {proto.IAccountID|null} [accountId] A payer account identifier. + * @property {Array.|null} [fees] The maximum fees that the user is willing to pay for the message. + */ + + /** + * Constructs a new CustomFeeLimit. + * @memberof proto + * @classdesc A maximum custom fee that the user is willing to pay. + *

+ * This message is used to specify the maximum custom fee that given user is + * willing to pay. + * @implements ICustomFeeLimit + * @constructor + * @param {proto.ICustomFeeLimit=} [p] Properties to set + */ + function CustomFeeLimit(p) { + this.fees = []; + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * A payer account identifier. + * @member {proto.IAccountID|null|undefined} accountId + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.accountId = null; + + /** + * The maximum fees that the user is willing to pay for the message. + * @member {Array.} fees + * @memberof proto.CustomFeeLimit + * @instance + */ + CustomFeeLimit.prototype.fees = $util.emptyArray; + + /** + * Creates a new CustomFeeLimit instance using the specified properties. + * @function create + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit=} [properties] Properties to set + * @returns {proto.CustomFeeLimit} CustomFeeLimit instance + */ + CustomFeeLimit.create = function create(properties) { + return new CustomFeeLimit(properties); + }; + + /** + * Encodes the specified CustomFeeLimit message. Does not implicitly {@link proto.CustomFeeLimit.verify|verify} messages. + * @function encode + * @memberof proto.CustomFeeLimit + * @static + * @param {proto.ICustomFeeLimit} m CustomFeeLimit message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomFeeLimit.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.accountId != null && Object.hasOwnProperty.call(m, "accountId")) + $root.proto.AccountID.encode(m.accountId, w.uint32(10).fork()).ldelim(); + if (m.fees != null && m.fees.length) { + for (var i = 0; i < m.fees.length; ++i) + $root.proto.FixedFee.encode(m.fees[i], w.uint32(18).fork()).ldelim(); + } + return w; + }; + + /** + * Decodes a CustomFeeLimit message from the specified reader or buffer. + * @function decode + * @memberof proto.CustomFeeLimit + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.CustomFeeLimit} CustomFeeLimit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomFeeLimit.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.CustomFeeLimit(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.accountId = $root.proto.AccountID.decode(r, r.uint32()); + break; + } + case 2: { + if (!(m.fees && m.fees.length)) + m.fees = []; + m.fees.push($root.proto.FixedFee.decode(r, r.uint32())); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for CustomFeeLimit + * @function getTypeUrl + * @memberof proto.CustomFeeLimit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomFeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.CustomFeeLimit"; + }; + + return CustomFeeLimit; + })(); + + proto.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof proto + * @interface ITimestamp + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @property {number|null} [nanos] The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + */ + + /** + * Constructs a new Timestamp. + * @memberof proto + * @classdesc An exact date and time.
+ * This is the same data structure as the Google protobuf Timestamp.proto. + * + * #### Additional Notes + * Useful information is present in comments on the + * [Google version](https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto). + * @implements ITimestamp + * @constructor + * @param {proto.ITimestamp=} [p] Properties to set + */ + function Timestamp(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * The number of nanoseconds after the start of the second referenced + * in `seconds`. + *

+ * This value MUST be greater than or equal to 0.
+ * This value MUST be strictly less than 1,000,000,000. + * @member {number} nanos + * @memberof proto.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp=} [properties] Properties to set + * @returns {proto.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link proto.Timestamp.verify|verify} messages. + * @function encode + * @memberof proto.Timestamp + * @static + * @param {proto.ITimestamp} m Timestamp message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + if (m.nanos != null && Object.hasOwnProperty.call(m, "nanos")) + w.uint32(16).int32(m.nanos); + return w; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof proto.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.Timestamp(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + case 2: { + m.nanos = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof proto.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.Timestamp"; + }; + + return Timestamp; + })(); + + proto.TimestampSeconds = (function() { + + /** + * Properties of a TimestampSeconds. + * @memberof proto + * @interface ITimestampSeconds + * @property {Long|null} [seconds] The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + */ + + /** + * Constructs a new TimestampSeconds. + * @memberof proto + * @classdesc An exact date and time, with a resolution of one second. + * @implements ITimestampSeconds + * @constructor + * @param {proto.ITimestampSeconds=} [p] Properties to set + */ + function TimestampSeconds(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The number of complete seconds since the start of the epoch. + *

+ * For this purpose, `epoch` SHALL be the UNIX epoch with 0 + * at `1970-01-01T00:00:00.000Z`.
+ * This value MUST be greater than 0.
+ * This value SHOULD be strictly greater than `946684800`. + * @member {Long} seconds + * @memberof proto.TimestampSeconds + * @instance + */ + TimestampSeconds.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TimestampSeconds instance using the specified properties. + * @function create + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds=} [properties] Properties to set + * @returns {proto.TimestampSeconds} TimestampSeconds instance + */ + TimestampSeconds.create = function create(properties) { + return new TimestampSeconds(properties); + }; + + /** + * Encodes the specified TimestampSeconds message. Does not implicitly {@link proto.TimestampSeconds.verify|verify} messages. + * @function encode + * @memberof proto.TimestampSeconds + * @static + * @param {proto.ITimestampSeconds} m TimestampSeconds message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampSeconds.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.seconds != null && Object.hasOwnProperty.call(m, "seconds")) + w.uint32(8).int64(m.seconds); + return w; + }; + + /** + * Decodes a TimestampSeconds message from the specified reader or buffer. + * @function decode + * @memberof proto.TimestampSeconds + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {proto.TimestampSeconds} TimestampSeconds + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampSeconds.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.proto.TimestampSeconds(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.seconds = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for TimestampSeconds + * @function getTypeUrl + * @memberof proto.TimestampSeconds + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampSeconds.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/proto.TimestampSeconds"; + }; + + return TimestampSeconds; + })(); + + return proto; +})(); + +export const google = $root.google = (() => { + + /** + * Namespace google. + * @exports google + * @namespace + */ + const google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + const protobuf = {}; + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] The uint32 value. + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint32`. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [p] Properties to set + */ + function UInt32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint32 value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} m UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint32(m.value); + return w; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] The string value. + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `string`. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [p] Properties to set + */ + function StringValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The string value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} m StringValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).string(m.value); + return w; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.StringValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.string(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] The bool value. + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bool`. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [p] Properties to set + */ + function BoolValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bool value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} m BoolValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).bool(m.value); + return w; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BoolValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bool(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] The bytes value. + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `bytes`. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [p] Properties to set + */ + function BytesValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The bytes value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} m BytesValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(10).bytes(m.value); + return w; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.BytesValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.bytes(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {Long|null} [value] The uint64 value. + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `uint64`. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [p] Properties to set + */ + function UInt64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The uint64 value. + * @member {Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} m UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).uint64(m.value); + return w; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.UInt64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.uint64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] The int32 value. + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int32`. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [p] Properties to set + */ + function Int32Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int32 value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} m Int32Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int32(m.value); + return w; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int32Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int32(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {Long|null} [value] The int64 value. + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Wrapper message for `int64`. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [p] Properties to set + */ + function Int64Value(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The int64 value. + * @member {Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} m Int64Value message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(8).int64(m.value); + return w; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.Int64Value(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.int64(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] The float value. + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `float`. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [p] Properties to set + */ + function FloatValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The float value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} m FloatValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(13).float(m.value); + return w; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.FloatValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.float(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] The double value. + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Wrapper message for `double`. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [p] Properties to set + */ + function DoubleValue(p) { + if (p) + for (var ks = Object.keys(p), i = 0; i < ks.length; ++i) + if (p[ks[i]] != null) + this[ks[i]] = p[ks[i]]; + } + + /** + * The double value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} m DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [w] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(m, w) { + if (!w) + w = $Writer.create(); + if (m.value != null && Object.hasOwnProperty.call(m, "value")) + w.uint32(9).double(m.value); + return w; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from + * @param {number} [l] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(r, l) { + if (!(r instanceof $Reader)) + r = $Reader.create(r); + var c = l === undefined ? r.len : r.pos + l, m = new $root.google.protobuf.DoubleValue(); + while (r.pos < c) { + var t = r.uint32(); + switch (t >>> 3) { + case 1: { + m.value = r.double(); + break; + } + default: + r.skipType(t & 7); + break; + } + } + return m; + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + return protobuf; + })(); + + return google; +})(); + +export { $root as default }; diff --git a/packages/proto/tsconfig.json b/packages/proto/tsconfig.json index 1fede34e6e..d6c7a8e5c4 100644 --- a/packages/proto/tsconfig.json +++ b/packages/proto/tsconfig.json @@ -21,5 +21,5 @@ "forceConsistentCasingInFileNames": true }, "include": ["src"], - "exclude": ["src/proto.js"] + "exclude": ["src/proto.js", "src/minimal/*.js"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 269a9c5d4a..efb3efe13f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,11 +27,11 @@ importers: specifier: ^1.12.6 version: 1.12.6 '@hashgraph/cryptography': - specifier: 1.9.0 - version: 1.9.0(react-native@0.78.0(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@19.0.0)) + specifier: file:.yalc/@hashgraph/cryptography + version: file:.yalc/@hashgraph/cryptography(react-native@0.78.0(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@19.0.0)) '@hashgraph/proto': - specifier: 2.22.0 - version: 2.22.0 + specifier: file:.yalc/@hashgraph/proto + version: file:.yalc/@hashgraph/proto bignumber.js: specifier: ^9.1.1 version: 9.1.2 @@ -41,6 +41,9 @@ importers: crypto-js: specifier: ^4.2.0 version: 4.2.0 + import-sync: + specifier: ^2.2.3 + version: 2.2.3 js-base64: specifier: ^3.7.4 version: 3.7.7 @@ -1512,8 +1515,8 @@ packages: engines: {node: '>=6'} hasBin: true - '@hashgraph/cryptography@1.9.0': - resolution: {integrity: sha512-0UItolO1W/f8YIsGBrIxvjY+cSdvs4sEdzXOL49ThYEfPskJUprG3vhMhosRFoA4d0hxdJ7/glB7f7He8RW9xg==} + '@hashgraph/cryptography@file:.yalc/@hashgraph/cryptography': + resolution: {directory: .yalc/@hashgraph/cryptography, type: directory} engines: {node: '>=12.0.0'} peerDependencies: expo-crypto: '*' @@ -1521,10 +1524,14 @@ packages: expo-crypto: optional: true - '@hashgraph/proto@2.22.0': - resolution: {integrity: sha512-+h2qqk+KwpV+rr1AN4ip1Gel3X4v0DvFO9WH7o0ZR3gQX9pfzurptKGs30DlBnH21xPqDH61v90bZvVknE27NA==} + '@hashgraph/proto@file:.yalc/@hashgraph/proto': + resolution: {directory: .yalc/@hashgraph/proto, type: directory} engines: {node: '>=10.0.0'} + '@httptoolkit/esm@3.3.2': + resolution: {integrity: sha512-mpB6FdMtn+c17RA6b6PDdsJXBLHG4P8ZJFK7sjS4IZn689kcOwjt90Ct+oxTaYo9pvCSb/GeTSjYEzoBv+bnbQ==} + engines: {node: '>=6'} + '@humanwhocodes/config-array@0.13.0': resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} engines: {node: '>=10.10.0'} @@ -3691,6 +3698,9 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import-sync@2.2.3: + resolution: {integrity: sha512-ZnF84+eGjetsXwYEuFZADO4eCYr1ngBo6UK476Oq4q6dkiDM1TN+6D5iQ5/e3erCyjo7O6xT3xHE6xdtCgDYhw==} + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -7561,7 +7571,7 @@ snapshots: protobufjs: 7.2.5 yargs: 17.7.2 - '@hashgraph/cryptography@1.9.0(react-native@0.78.0(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@19.0.0))': + '@hashgraph/cryptography@file:.yalc/@hashgraph/cryptography(react-native@0.78.0(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(react@19.0.0))': dependencies: '@noble/curves': 1.8.2 asn1js: 3.0.6 @@ -7578,11 +7588,13 @@ snapshots: transitivePeerDependencies: - react-native - '@hashgraph/proto@2.22.0': + '@hashgraph/proto@file:.yalc/@hashgraph/proto': dependencies: long: 5.3.1 protobufjs: 7.2.5 + '@httptoolkit/esm@3.3.2': {} + '@humanwhocodes/config-array@0.13.0': dependencies: '@humanwhocodes/object-schema': 2.0.3 @@ -10140,6 +10152,10 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + import-sync@2.2.3: + dependencies: + '@httptoolkit/esm': 3.3.2 + imurmurhash@0.1.4: {} indent-string@4.0.0: {} diff --git a/src/transaction/DynamicTransactionEncoder.js b/src/transaction/DynamicTransactionEncoder.js new file mode 100644 index 0000000000..6062d7eeba --- /dev/null +++ b/src/transaction/DynamicTransactionEncoder.js @@ -0,0 +1,432 @@ +// SPDX-License-Identifier: Apache-2.0 + +import importSync from "import-sync"; + +//import importSync from "import-sync"; + +/** + * Dynamic transaction encoder that imports transaction-specific proto encoders + * This enables tree-shaking and reduces bundle size by only loading the needed proto code + */ + +/** + * Maps transaction data case names to their corresponding proto module names + * This mapping converts proto field names (e.g., "fileAppend") to class names (e.g., "FileAppendTransaction") + * @type {Record} + */ +const TRANSACTION_PROTO_MAPPING = { + // Account transactions + cryptoCreateAccount: "CryptoCreateTransaction", + cryptoUpdate: "CryptoUpdateTransaction", + cryptoTransfer: "CryptoTransferTransaction", + cryptoDelete: "CryptoDeleteTransaction", + cryptoApproveAllowance: "CryptoApproveAllowanceTransaction", + cryptoDeleteAllowance: "CryptoDeleteAllowanceTransaction", + + // File transactions + fileCreate: "FileCreateTransaction", + fileAppend: "FileAppendTransaction", + fileUpdate: "FileUpdateTransaction", + fileDelete: "FileDeleteTransaction", + + // Contract transactions + contractCreateInstance: "ContractCreateTransaction", + contractUpdateInstance: "ContractUpdateTransaction", + contractCall: "ContractCallTransaction", + contractDeleteInstance: "ContractDeleteTransaction", + + // Topic transactions + consensusCreateTopic: "ConsensusCreateTopicTransaction", + consensusUpdateTopic: "ConsensusUpdateTopicTransaction", + consensusDeleteTopic: "ConsensusDeleteTopicTransaction", + consensusSubmitMessage: "ConsensusSubmitMessageTransaction", + + // Token transactions + tokenCreation: "TokenCreateTransaction", + tokenUpdate: "TokenUpdateTransaction", + tokenMint: "TokenMintTransaction", + tokenBurn: "TokenBurnTransaction", + tokenDeletion: "TokenDeleteTransaction", + tokenWipe: "TokenWipeAccountTransaction", + tokenFreeze: "TokenFreezeAccountTransaction", + tokenUnfreeze: "TokenUnfreezeAccountTransaction", + tokenGrantKyc: "TokenGrantKycTransaction", + tokenRevokeKyc: "TokenRevokeKycTransaction", + tokenAssociate: "TokenAssociateTransaction", + tokenDissociate: "TokenDissociateTransaction", + tokenFeeScheduleUpdate: "TokenFeeScheduleUpdateTransaction", + tokenPause: "TokenPauseTransaction", + tokenUnpause: "TokenUnpauseTransaction", + tokenUpdateNfts: "TokenUpdateNftsTransaction", + tokenReject: "TokenRejectTransaction", + tokenAirdrop: "TokenAirdropTransaction", + tokenCancelAirdrop: "TokenCancelAirdropTransaction", + tokenClaimAirdrop: "TokenClaimAirdropTransaction", + + // Schedule transactions + scheduleCreate: "ScheduleCreateTransaction", + scheduleDelete: "ScheduleDeleteTransaction", + scheduleSign: "ScheduleSignTransaction", + + // System transactions + freeze: "FreezeTransaction", + systemDelete: "SystemDeleteTransaction", + systemUndelete: "SystemUndeleteTransaction", + + // Node transactions + nodeCreate: "NodeCreateTransaction", + nodeUpdate: "NodeUpdateTransaction", + nodeDelete: "NodeDeleteTransaction", + nodeStakeUpdate: "NodeStakeUpdateTransaction", + + // Other transactions + utilPrng: "UtilPrngTransaction", + ethereumTransaction: "EthereumTransactionTransaction", + atomicBatch: "AtomicBatchTransaction", +}; + +// --- Minimal oneof discriminator helpers --- +// These helpers avoid importing full @hashgraph/proto by peeking field tags +// of proto.TransactionBody to determine which `data` arm is present. + +/** + * Known top-level non-oneof field numbers in proto.TransactionBody + * Keep this list in sync with minimal_src definitions + */ +const NON_ONEOF_TRANSACTION_BODY_FIELDS = new Set([1, 2, 3, 4, 6, 73, 1001]); + +/** + * Detects which oneof `data` field number is present in a TransactionBody + * without decoding with a full schema. + * Returns the field number (e.g., 16 for fileAppend) or null if none found. + * + * @param {Uint8Array} bodyBytes + * @returns {number | null} + */ +export function detectTransactionBodyDataFieldNumber(bodyBytes) { + // Lazy import to avoid hard dependency unless used + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { Reader } = require("protobufjs/minimal"); + const reader = Reader.create(bodyBytes); + + while (reader.pos < reader.len) { + const tag = reader.uint32(); + const fieldNumber = tag >>> 3; + const wireType = tag & 7; + + if (!NON_ONEOF_TRANSACTION_BODY_FIELDS.has(fieldNumber)) { + // Oneof arms are messages → length-delimited + if (wireType === 2) { + return fieldNumber; + } + } + + reader.skipType(wireType); + } + + return null; +} + +/** + * Optional mapping from TransactionBody oneof `data` field numbers to case strings. + * Extend as needed. Only include values you need to detect. + * @type {Record} + */ +export const TRANSACTION_BODY_FIELD_NUMBER_TO_CASE = { + // Contract + 7: "contractCall", + 8: "contractCreateInstance", + 9: "contractUpdateInstance", + 22: "contractDeleteInstance", + + // Crypto + 11: "cryptoCreateAccount", + 12: "cryptoDelete", + 14: "cryptoTransfer", + 15: "cryptoUpdate", + 48: "cryptoApproveAllowance", + 49: "cryptoDeleteAllowance", + + // File + 16: "fileAppend", + 17: "fileCreate", + 18: "fileDelete", + 19: "fileUpdate", + + // System + 20: "systemDelete", + 21: "systemUndelete", + 23: "freeze", + + // Consensus (Topic) + 24: "consensusCreateTopic", + 25: "consensusUpdateTopic", + 26: "consensusDeleteTopic", + 27: "consensusSubmitMessage", + + // Token + 29: "tokenCreation", + 31: "tokenFreeze", + 32: "tokenUnfreeze", + 33: "tokenGrantKyc", + 34: "tokenRevokeKyc", + 35: "tokenDeletion", + 36: "tokenUpdate", + 37: "tokenMint", + 38: "tokenBurn", + 39: "tokenWipe", + 40: "tokenAssociate", + 41: "tokenDissociate", + 45: "tokenFeeScheduleUpdate", + 46: "tokenPause", + 47: "tokenUnpause", + 53: "tokenUpdateNfts", + 57: "tokenReject", + 58: "tokenAirdrop", + 59: "tokenCancelAirdrop", + 60: "tokenClaimAirdrop", + + // Schedule + 42: "scheduleCreate", + 43: "scheduleDelete", + 44: "scheduleSign", + + // Other + 50: "ethereumTransaction", + 51: "nodeStakeUpdate", + 52: "utilPrng", + 54: "nodeCreate", + 55: "nodeUpdate", + 56: "nodeDelete", + 74: "atomicBatch", +}; + +/** + * + * @param {Uint8Array} bodyBytes + * @returns + */ +export function decodeTransactionBodyAutoSync(bodyBytes) { + const dataCase = detectTransactionBodyCaseFromBytes(bodyBytes); + console.log(dataCase); + + if (!dataCase) { + throw new Error("Unknown transaction type"); + } + + // Get the file name from direct mapping + const fileName = TRANSACTION_CASE_TO_FILE_NAME[dataCase]; + if (!fileName) { + throw new Error("Unknown transaction type"); + } + + try { + // Use importSync for synchronous dynamic import + const protoModule = importSync( + `@hashgraph/proto/lib/minimal/${fileName}`, + ); + return protoModule.proto.TransactionBody.decode(bodyBytes); + } catch (error) { + console.warn(`Failed to load ${dataCase} module:`, error); + } +} + +/** + * + * @param {Uint8Array} bodyBytes + * @returns + */ +export function encodeTransactionBodyAutoSync(bodyBytes) { + const dataCase = detectTransactionBodyCaseFromBytes(bodyBytes); + console.log(dataCase); + + if (!dataCase) { + throw new Error("Unknown transaction type"); + } + + // Get the file name from direct mapping + const fileName = TRANSACTION_CASE_TO_FILE_NAME[dataCase]; + if (!fileName) { + throw new Error("Unknown transaction type"); + } + + try { + // Use importSync for synchronous dynamic import + const protoModule = importSync( + `@hashgraph/proto/lib/minimal/${fileName}`, + ); + return protoModule.proto.TransactionBody.encode(bodyBytes); + } catch (error) { + console.warn(`Failed to load ${dataCase} module:`, error); + } +} + +/** + * + * @param {import("@hashgraph/proto").proto.ITransaction} body + * @param {string} transactionDataCase + * @returns + */ +export function encodeTransactionDynamic(body, transactionDataCase) { + // Get the file name from direct mapping + const fileName = TRANSACTION_CASE_TO_FILE_NAME[transactionDataCase]; + if (!fileName) { + throw new Error("Unknown transaction type"); + } + + try { + // Use importSync for synchronous dynamic import + const protoModule = importSync( + `@hashgraph/proto/lib/minimal/${fileName}`, + ); + return protoModule.proto.Transaction.encode(body); + } catch (error) { + console.warn(`Failed to load ${transactionDataCase} module:`, error); + } +} + +/** + * Detects the TransactionBody oneof case string directly from bytes, when mapped. + * Falls back to null if unknown. + * + * @param {Uint8Array} bodyBytes + * @returns {string | null} + */ +export function detectTransactionBodyCaseFromBytes(bodyBytes) { + const field = detectTransactionBodyDataFieldNumber(bodyBytes); + if (field == null) return null; + return TRANSACTION_BODY_FIELD_NUMBER_TO_CASE[field] ?? null; +} + +/** + * Direct mapping from transaction data case to actual file names + * @type {Record} + */ +const TRANSACTION_CASE_TO_FILE_NAME = { + // Contract + contractCall: "contract_call_transaction.js", + contractCreateInstance: "contract_create_transaction.js", + contractUpdateInstance: "contract_update_transaction.js", + contractDeleteInstance: "contract_delete_transaction.js", + + // Crypto + cryptoCreateAccount: "crypto_create_transaction.js", + cryptoDelete: "crypto_delete_transaction.js", + cryptoTransfer: "crypto_transfer_transaction.js", + cryptoUpdate: "crypto_update_transaction.js", + cryptoApproveAllowance: "crypto_approve_allowance_transaction.js", + cryptoDeleteAllowance: "crypto_delete_allowance_transaction.js", + + // File + fileCreate: "file_create_transaction.js", + fileAppend: "file_append_transaction.js", + fileUpdate: "file_update_transaction.js", + fileDelete: "file_delete_transaction.js", + + // System + systemDelete: "system_delete_transaction.js", + systemUndelete: "system_undelete_transaction.js", + freeze: "freeze_transaction.js", + + // Consensus (Topic) + consensusCreateTopic: "consensus_create_topic_transaction.js", + consensusUpdateTopic: "consensus_update_topic_transaction.js", + consensusDeleteTopic: "consensus_delete_topic_transaction.js", + consensusSubmitMessage: "consensus_submit_message_transaction.js", + + // Token + tokenCreation: "token_create_transaction.js", + tokenUpdate: "token_update_transaction.js", + tokenMint: "token_mint_transaction.js", + tokenBurn: "token_burn_transaction.js", + tokenDeletion: "token_delete_transaction.js", + tokenWipe: "token_wipe_account_transaction.js", + tokenFreeze: "token_freeze_account_transaction.js", + tokenUnfreeze: "token_unfreeze_account_transaction.js", + tokenGrantKyc: "token_grant_kyc_transaction.js", + tokenRevokeKyc: "token_revoke_kyc_transaction.js", + tokenAssociate: "token_associate_transaction.js", + tokenDissociate: "token_dissociate_transaction.js", + tokenFeeScheduleUpdate: "token_fee_schedule_update_transaction.js", + tokenPause: "token_pause_transaction.js", + tokenUnpause: "token_unpause_transaction.js", + tokenUpdateNfts: "token_update_nfts_transaction.js", + tokenReject: "token_reject_transaction.js", + tokenAirdrop: "token_airdrop_transaction.js", + tokenCancelAirdrop: "token_cancel_airdrop_transaction.js", + tokenClaimAirdrop: "token_claim_airdrop_transaction.js", + + // Schedule + scheduleCreate: "schedule_create_transaction.js", + scheduleDelete: "schedule_delete_transaction.js", + scheduleSign: "schedule_sign_transaction.js", + + // Other + ethereumTransaction: "ethereum_transaction_transaction.js", + nodeStakeUpdate: "node_stake_update_transaction.js", + utilPrng: "util_prng_transaction.js", + nodeCreate: "node_create_transaction.js", + nodeUpdate: "node_update_transaction.js", + nodeDelete: "node_delete_transaction.js", + atomicBatch: "atomic_batch_transaction.js", +}; + +// Add this to DynamicTransactionEncoder.js +export const TRANSACTION_FIELD_NUMBER_TO_CASE = Object.fromEntries( + Object.entries(TRANSACTION_BODY_FIELD_NUMBER_TO_CASE).map( + ([fieldNumber, caseName]) => [parseInt(fieldNumber), caseName], + ), +); + +/** + * Encodes transaction body using field number + * @param {any} body - The transaction body to encode + * @param {number} fieldNumber - The protobuf field number + * @returns {Uint8Array} The encoded transaction body bytes + */ +export function encodeTransactionBodyByFieldNumber(body, fieldNumber) { + const transactionDataCase = TRANSACTION_FIELD_NUMBER_TO_CASE[fieldNumber]; + + if (!transactionDataCase) { + throw new Error(`Unknown field number: ${fieldNumber}`); + } + + return encodeTransactionBodyDynamic(body, transactionDataCase); +} + +/** + * Dynamically encodes a transaction body using the specific transaction proto module + * @param {any} body - The transaction body to encode + * @param {string} transactionDataCase - The transaction data case (e.g., "fileCreate") + * @returns {Uint8Array} The encoded transaction body bytes + */ +export function encodeTransactionBodyDynamic(body, transactionDataCase) { + // Get the file name from the transaction data case + const fileName = TRANSACTION_CASE_TO_FILE_NAME[transactionDataCase]; + + if (!fileName) { + throw new Error(`Unknown transaction type: ${transactionDataCase}`); + } + + try { + // Use importSync for synchronous dynamic import + const protoModule = importSync( + `@hashgraph/proto/lib/minimal/${fileName}`, + ); + + // Use the specific transaction proto module to encode + return protoModule.proto.TransactionBody.encode(body).finish(); + } catch (error) { + console.warn(`Failed to load ${transactionDataCase} module:`, error); + throw new Error( + `Failed to encode transaction body for type: ${transactionDataCase}`, + ); + } +} + +export default { + decodeTransactionBodyAutoSync, + encodeTransactionBodyAutoSync, + encodeTransactionDynamic, + TRANSACTION_PROTO_MAPPING, +}; diff --git a/src/transaction/Transaction.js b/src/transaction/Transaction.js index edef888a14..13245daf11 100644 --- a/src/transaction/Transaction.js +++ b/src/transaction/Transaction.js @@ -12,6 +12,12 @@ import Long from "long"; import * as sha384 from "../cryptography/sha384.js"; import * as hex from "../encoding/hex.js"; import * as HieroProto from "@hashgraph/proto"; + +import { + FileAppendTransaction, + TransactionContents, + TransactionResponse as TransactionResponseProto, +} from "@hashgraph/proto/minimal"; import PrecheckStatusError from "../PrecheckStatusError.js"; import AccountId from "../account/AccountId.js"; import PublicKey from "../PublicKey.js"; @@ -21,6 +27,15 @@ import * as util from "../util.js"; import CustomFeeLimit from "./CustomFeeLimit.js"; import Key from "../Key.js"; import SignableNodeTransactionBodyBytes from "./SignableNodeTransactionBodyBytes.js"; +import { + decodeTransactionBodyAutoSync, + encodeTransactionBodyAutoSync, + encodeTransactionBodyDynamic, + encodeTransactionDynamic, +} from "./DynamicTransactionEncoder.js"; + +// Extract SignedTransaction from TransactionContentsProto +const SignedTransaction = TransactionContents.proto.SignedTransaction; /** * @typedef {import("bignumber.js").default} BigNumber @@ -57,7 +72,7 @@ const DEFAULT_TRANSACTION_VALID_DURATION = 120; export const CHUNK_SIZE = 1024; /** - * @type {Map, (transactions: HieroProto.proto.ITransaction[], signedTransactions: HieroProto.proto.ISignedTransaction[], transactionIds: TransactionId[], nodeIds: AccountId[], bodies: HieroProto.proto.TransactionBody[]) => Transaction>} + * @type {Map, (transactions: import("@hashgraph/proto").proto.ITransaction[], signedTransactions: import("@hashgraph/proto").proto.ISignedTransaction[], transactionIds: TransactionId[], nodeIds: AccountId[], bodies: import("@hashgraph/proto").proto.TransactionBody[]) => Transaction>} */ export const TRANSACTION_REGISTRY = new Map(); @@ -65,7 +80,7 @@ export const TRANSACTION_REGISTRY = new Map(); * Base class for all transactions that may be submitted to Hedera. * * @abstract - * @augments {Executable} + * @augments {Executable} */ export default class Transaction extends Executable { // A SDK transaction is composed of multiple, raw protobuf transactions. @@ -87,7 +102,7 @@ export default class Transaction extends Executable { * where `rowLength` is `nodeAccountIds.length` * * @internal - * @type {List} + * @type {List} */ this._transactions = new List(); @@ -100,7 +115,7 @@ export default class Transaction extends Executable { * where `rowLength` is `nodeAccountIds.length` * * @internal - * @type {List} + * @type {List} */ this._signedTransactions = new List(); @@ -219,7 +234,7 @@ export default class Transaction extends Executable { * @returns {Transaction} */ static fromBytes(bytes) { - /** @type {HieroProto.proto.ISignedTransaction[]} */ + /** @type {import("@hashgraph/proto").proto.ISignedTransaction[]} */ const signedTransactions = []; /** @type {TransactionId[]} */ @@ -234,11 +249,13 @@ export default class Transaction extends Executable { /** @type {string[]} */ const nodeIdStrings = []; - /** @type {HieroProto.proto.TransactionBody[]} */ + /** @type {any[]} */ const bodies = []; const list = - HieroProto.proto.TransactionList.decode(bytes).transactionList; + FileAppendTransaction.proto.TransactionList.decode( + bytes, + ).transactionList; // If the list is of length 0, then teh bytes provided were not a // `proto.TransactionList` @@ -256,7 +273,7 @@ export default class Transaction extends Executable { } else { list.push({ signedTransactionBytes: - HieroProto.proto.SignedTransaction.encode({ + TransactionContents.proto.SignedTransaction.encode({ sigMap: transaction.sigMap, bodyBytes: transaction.bodyBytes, }).finish(), @@ -279,14 +296,15 @@ export default class Transaction extends Executable { if (transaction.bodyBytes && transaction.bodyBytes.length != 0) { // Decode a transaction - const body = HieroProto.proto.TransactionBody.decode( + const body = decodeTransactionBodyAutoSync( transaction.bodyBytes, ); // Make sure the transaction ID within the body is set if (body.transactionID != null) { const transactionId = TransactionId._fromProtobuf( - /** @type {HieroProto.proto.ITransactionID} */ ( + // @ts-ignore + /** @type {import("@hashgraph/proto").proto.ITransactionID} */ ( body.transactionID ), ); @@ -303,7 +321,7 @@ export default class Transaction extends Executable { // Make sure the node account ID within the body is set if (body.nodeAccountID != null) { const nodeAccountId = AccountId._fromProtobuf( - /** @type {HieroProto.proto.IAccountID} */ ( + /** @type {import("@hashgraph/proto").proto.IAccountID} */ ( body.nodeAccountID ), ); @@ -331,13 +349,14 @@ export default class Transaction extends Executable { ) { // Decode a signed transaction const signedTransaction = - HieroProto.proto.SignedTransaction.decode( + TransactionContents.proto.SignedTransaction.decode( transaction.signedTransactionBytes, ); signedTransactions.push(signedTransaction); // Decode a transaction body + const body = HieroProto.proto.TransactionBody.decode( signedTransaction.bodyBytes, ); @@ -345,7 +364,8 @@ export default class Transaction extends Executable { // Make sure the transaction ID within the body is set if (body.transactionID != null) { const transactionId = TransactionId._fromProtobuf( - /** @type {HieroProto.proto.ITransactionID} */ ( + // @ts-ignore + /** @type {import("@hashgraph/proto").proto.ITransactionID} */ ( body.transactionID ), ); @@ -362,7 +382,8 @@ export default class Transaction extends Executable { // Make sure the node account ID within the body is set if (body.nodeAccountID != null) { const nodeAccountId = AccountId._fromProtobuf( - /** @type {HieroProto.proto.IAccountID} */ ( + // @ts-ignore + /** @type {import("@hashgraph/proto").proto.IAccountID} */ ( body.nodeAccountID ), ); @@ -454,11 +475,11 @@ export default class Transaction extends Executable { * * @template {Transaction} TransactionT * @param {TransactionT} transaction - * @param {HieroProto.proto.ITransaction[]} transactions - * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions + * @param {import("@hashgraph/proto").proto.ITransaction[]} transactions + * @param {import("@hashgraph/proto").proto.ISignedTransaction[]} signedTransactions * @param {TransactionId[]} transactionIds * @param {AccountId[]} nodeIds - * @param {HieroProto.proto.ITransactionBody[]} bodies + * @param {any[]} bodies * @returns {TransactionT} */ static _fromProtobufTransactions( @@ -520,15 +541,18 @@ export default class Transaction extends Executable { transaction._maxTransactionFee = body.transactionFee != null && body.transactionFee > new Long(0, 0, true) - ? Hbar.fromTinybars(body.transactionFee) + ? // @ts-ignore + Hbar.fromTinybars(body.transactionFee) : null; transaction._customFeeLimits = body.maxCustomFees != null - ? body.maxCustomFees?.map((fee) => + ? body.maxCustomFees?.map((/** @type {any} */ fee) => + // @ts-ignore CustomFeeLimit._fromProtobuf(fee), ) : []; transaction._batchKey = + // @ts-ignore body.batchKey != null ? Key._fromProtobufKey(body?.batchKey) : null; transaction._transactionMemo = body.memo != null ? body.memo : ""; @@ -611,7 +635,10 @@ export default class Transaction extends Executable { get bodySize() { const body = this._makeTransactionBody(AccountId.fromString("0.0.0")); - return HieroProto.proto.TransactionBody.encode(body).finish().length; + return encodeTransactionBodyDynamic( + body, + this._getTransactionDataCase(), + ).length; } /** @@ -968,9 +995,7 @@ export default class Transaction extends Executable { if (signedTransaction.bodyBytes) { const { transactionID, nodeAccountID } = - HieroProto.proto.TransactionBody.decode( - signedTransaction.bodyBytes, - ); + decodeTransactionBodyAutoSync(signedTransaction.bodyBytes); if (!transactionID || !nodeAccountID) { throw new Error( @@ -979,7 +1004,9 @@ export default class Transaction extends Executable { } const transactionId = + // @ts-ignore TransactionId._fromProtobuf(transactionID); + // @ts-ignore const nodeAccountId = AccountId._fromProtobuf(nodeAccountID); const nodeSignatures = signatureMap.get(nodeAccountId); @@ -1324,7 +1351,7 @@ export default class Transaction extends Executable { throw new Error("Missing bodyBytes in signed transaction."); } - const body = HieroProto.proto.TransactionBody.decode( + const body = decodeTransactionBodyAutoSync( signedTransaction.bodyBytes, ); @@ -1332,12 +1359,14 @@ export default class Transaction extends Executable { throw new Error("Missing nodeAccountID in transaction body."); } + // @ts-ignore const nodeAccountId = AccountId._fromProtobuf(body.nodeAccountID); if (!body.transactionID) { throw new Error("Missing transactionID in transaction body."); } const transactionId = TransactionId._fromProtobuf( + // @ts-ignore body.transactionID, ); @@ -1526,9 +1555,10 @@ export default class Transaction extends Executable { // Construct and encode the transaction list return HieroProto.proto.TransactionList.encode({ - transactionList: /** @type {HieroProto.proto.ITransaction[]} */ ( - this._transactions.list - ), + transactionList: + /** @type {import("@hashgraph/proto").proto.ITransaction[]} */ ( + this._transactions.list + ), }).finish(); } @@ -1558,9 +1588,10 @@ export default class Transaction extends Executable { // Construct and encode the transaction list return HieroProto.proto.TransactionList.encode({ - transactionList: /** @type {HieroProto.proto.ITransaction[]} */ ( - this._transactions.list - ), + transactionList: + /** @type {import("@hashgraph/proto").proto.ITransaction[]} */ ( + this._transactions.list + ), }).finish(); } @@ -1584,7 +1615,7 @@ export default class Transaction extends Executable { return sha384.digest( /** @type {Uint8Array} */ ( - /** @type {HieroProto.proto.ITransaction} */ ( + /** @type {import("@hashgraph/proto").proto.ITransaction} */ ( this._transactions.get(0) ).signedTransactionBytes ), @@ -1638,6 +1669,7 @@ export default class Transaction extends Executable { * @param {Client} client */ // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function + // @ts-ignore _validateChecksums(client) { // Do nothing } @@ -1701,7 +1733,7 @@ export default class Transaction extends Executable { * * @override * @internal - * @returns {Promise} + * @returns {Promise} */ async _makeRequestAsync() { // The index for the transaction @@ -1713,7 +1745,7 @@ export default class Transaction extends Executable { // and return the result, without signing if (!this._signOnDemand && !this._isThrottled) { this._buildTransaction(index); - return /** @type {HieroProto.proto.ITransaction} */ ( + return /** @type {import("@hashgraph/proto").proto.ITransaction} */ ( this._transactions.get(index) ); } @@ -1726,7 +1758,7 @@ export default class Transaction extends Executable { * Sign a `proto.SignedTransaction` with all the keys * * @private - * @returns {Promise} + * @returns {Promise} */ async _signTransaction() { const signedTransaction = this._makeSignedTransaction( @@ -1835,19 +1867,17 @@ export default class Transaction extends Executable { // incomplete transaction must be updated in order to be prepared for execution if (this._transactions.list[index] != null) { this._transactions.set(index, { - signedTransactionBytes: - HieroProto.proto.SignedTransaction.encode( - this._signedTransactions.get(index), - ).finish(), + signedTransactionBytes: SignedTransaction.encode( + this._signedTransactions.get(index), + ).finish(), }); } this._transactions.setIfAbsent(index, () => { return { - signedTransactionBytes: - HieroProto.proto.SignedTransaction.encode( - this._signedTransactions.get(index), - ).finish(), + signedTransactionBytes: SignedTransaction.encode( + this._signedTransactions.get(index), + ).finish(), }; }); } @@ -1858,13 +1888,14 @@ export default class Transaction extends Executable { * `this._transactionIds.index` * * @private - * @returns {Promise} + * @returns {Promise} */ async _buildTransactionAsync() { return { - signedTransactionBytes: HieroProto.proto.SignedTransaction.encode( - await this._signTransaction(), - ).finish(), + signedTransactionBytes: + TransactionContents.proto.SignedTransaction.encode( + await this._signTransaction(), + ).finish(), }; } @@ -1873,11 +1904,12 @@ export default class Transaction extends Executable { * * @override * @internal - * @param {HieroProto.proto.ITransaction} request - * @param {HieroProto.proto.ITransactionResponse} response + * @param {import("@hashgraph/proto").proto.ITransaction} request + * @param {import("@hashgraph/proto").proto.ITransactionResponse} response * @returns {[Status, ExecutionState]} */ // eslint-disable-next-line @typescript-eslint/no-unused-vars + // @ts-ignore _shouldRetry(request, response) { const { nodeTransactionPrecheckCode } = response; @@ -1885,7 +1917,7 @@ export default class Transaction extends Executable { const status = Status._fromCode( nodeTransactionPrecheckCode != null ? nodeTransactionPrecheckCode - : HieroProto.proto.ResponseCodeEnum.OK, + : TransactionResponseProto.proto.ResponseCodeEnum.OK, ); if (this._logger) { @@ -1927,19 +1959,20 @@ export default class Transaction extends Executable { * * @override * @internal - * @param {HieroProto.proto.ITransaction} request - * @param {HieroProto.proto.ITransactionResponse} response + * @param {import("@hashgraph/proto").proto.ITransaction} request + * @param {import("@hashgraph/proto").proto.ITransactionResponse} response * @param {AccountId} nodeId * @returns {Error} */ // eslint-disable-next-line @typescript-eslint/no-unused-vars + // @ts-ignore _mapStatusError(request, response, nodeId) { const { nodeTransactionPrecheckCode } = response; const status = Status._fromCode( nodeTransactionPrecheckCode != null ? nodeTransactionPrecheckCode - : HieroProto.proto.ResponseCodeEnum.OK, + : TransactionResponseProto.proto.ResponseCodeEnum.OK, ); if (this._logger) { this._logger.info( @@ -1961,11 +1994,12 @@ export default class Transaction extends Executable { * * @override * @protected - * @param {HieroProto.proto.ITransactionResponse} response + * @param {import("@hashgraph/proto").proto.ITransactionResponse} response * @param {AccountId} nodeId - * @param {HieroProto.proto.ITransaction} request + * @param {import("@hashgraph/proto").proto.ITransaction} request * @returns {Promise} */ + // @ts-ignore async _mapResponse(response, nodeId, request) { const transactionHash = await sha384.digest( /** @type {Uint8Array} */ (request.signedTransactionBytes), @@ -2000,15 +2034,22 @@ export default class Transaction extends Executable { * * @internal * @param {?AccountId} nodeId - * @returns {HieroProto.proto.ISignedTransaction} + * @returns {import("@hashgraph/proto").proto.ISignedTransaction} */ _makeSignedTransaction(nodeId) { const body = this._makeTransactionBody(nodeId); + if (this._logger) { this._logger.info(`Transaction Body: ${JSON.stringify(body)}`); } - const bodyBytes = - HieroProto.proto.TransactionBody.encode(body).finish(); + + const transactionDataCase = this._getTransactionDataCase(); + + // Get the transaction data case and encode dynamically + const bodyBytes = encodeTransactionBodyDynamic( + body, + transactionDataCase, + ); return { sigMap: { @@ -2034,7 +2075,7 @@ export default class Transaction extends Executable { * * @private * @param {?AccountId} nodeId - * @returns {HieroProto.proto.ITransactionBody} + * @returns {import("@hashgraph/proto").proto.ITransactionBody} */ _makeTransactionBody(nodeId) { return { @@ -2044,20 +2085,24 @@ export default class Transaction extends Executable { ? this._maxTransactionFee.toTinybars() : null, memo: this._transactionMemo, + // @ts-ignore transactionID: this._transactionIds.current != null ? this._transactionIds.current._toProtobuf() : null, + // @ts-ignore nodeAccountID: nodeId != null ? nodeId._toProtobuf() : null, transactionValidDuration: { seconds: Long.fromNumber(this._transactionValidDuration), }, + // @ts-ignore maxCustomFees: this._customFeeLimits != null ? this._customFeeLimits.map((maxCustomFee) => maxCustomFee._toProtobuf(), ) : null, + // @ts-ignore batchKey: this.batchKey?._toProtobufKey(), }; } @@ -2069,7 +2114,7 @@ export default class Transaction extends Executable { * * @abstract * @protected - * @returns {NonNullable} + * @returns {NonNullable} */ _getTransactionDataCase() { throw new Error("not implemented"); @@ -2080,7 +2125,7 @@ export default class Transaction extends Executable { * FIXME: Should really call this `makeScheduledTransactionBody` to be consistent * * @internal - * @returns {HieroProto.proto.ISchedulableTransactionBody} + * @returns {import("@hashgraph/proto").proto.ISchedulableTransactionBody} */ _getScheduledTransactionBody() { return { @@ -2089,6 +2134,7 @@ export default class Transaction extends Executable { this._maxTransactionFee == null ? this._defaultMaxTransactionFee.toTinybars() : this._maxTransactionFee.toTinybars(), + // @ts-ignore maxCustomFees: this._customFeeLimits != null ? this._customFeeLimits.map((maxCustomFee) => @@ -2172,7 +2218,7 @@ export default class Transaction extends Executable { } /** - * @param {HieroProto.proto.Transaction} request + * @param {import("@hashgraph/proto").proto.Transaction} request * @returns {Uint8Array} */ _requestToBytes(request) { @@ -2180,17 +2226,19 @@ export default class Transaction extends Executable { } /** - * @param {HieroProto.proto.TransactionResponse} response + * @param {import("@hashgraph/proto").proto.TransactionResponse} response * @returns {Uint8Array} */ _responseToBytes(response) { - return HieroProto.proto.TransactionResponse.encode(response).finish(); + return TransactionResponseProto.proto.TransactionResponse.encode( + response, + ).finish(); } /** * Removes all signatures from a transaction and collects the removed signatures. * - * @param {HieroProto.proto.ISignedTransaction} transaction - The transaction object to process. + * @param {import("@hashgraph/proto").proto.ISignedTransaction} transaction - The transaction object to process. * @param {string} publicKeyHex - The hexadecimal representation of the public key. * @returns {Uint8Array[]} An array of removed signatures. */ @@ -2224,7 +2272,7 @@ export default class Transaction extends Executable { /** * Determines whether a signature should be removed based on the provided public key. * - * @param {HieroProto.proto.ISignaturePair} sigPair - The signature pair object that contains + * @param {import("@hashgraph/proto").proto.ISignaturePair} sigPair - The signature pair object that contains * the public key prefix and signature to be evaluated. * @param {string} publicKeyHex - The hexadecimal representation of the public key to compare against. * @returns {boolean} `true` if the public key prefix in the signature pair matches the provided public key, diff --git a/test/integration/AccountCreateIntegrationTest.js b/test/integration/AccountCreateIntegrationTest.js index 3c2d6e7cee..ed41eb897b 100644 --- a/test/integration/AccountCreateIntegrationTest.js +++ b/test/integration/AccountCreateIntegrationTest.js @@ -18,7 +18,7 @@ describe("AccountCreate", function () { env = await IntegrationTestEnv.new(); }); - it("should be executable", async function () { + it.only("should be executable", async function () { const operatorId = env.operatorId; const key = PrivateKey.generateED25519(); diff --git a/test/integration/TokenTransferIntegrationTest.js b/test/integration/TokenTransferIntegrationTest.js index 2ee1a0e57e..8776884fe3 100644 --- a/test/integration/TokenTransferIntegrationTest.js +++ b/test/integration/TokenTransferIntegrationTest.js @@ -22,7 +22,7 @@ describe("TokenTransfer", function () { env = await IntegrationTestEnv.new(); }); - it("should be executable", async function () { + it.only("should be executable", async function () { // Create token with required keys const token = await createFungibleToken(env.client, (transaction) => { transaction.setKycKey(env.operatorKey).setFreezeDefault(false);